summaryrefslogtreecommitdiffstats
path: root/libmount/src/cache.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: fix gtkdoc warningKarel Zak2018-09-241-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup licenses sections in the filesKarel Zak2018-08-161-4/+9
| | | | | | | | | * add SPDX-License-Identifier (see https://spdx.org/licenses/) * add "This file part of libmount from util-linux project." * use proper text for LGPL-2.1-or-later * use the same texts everywhere Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-141-3/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|
* libmount: ignore redundant slashesKarel Zak2016-08-081-1/+1
| | | | | | | | | | | | | | | ///aaa/bbb and /aaa/bbb/ are the same paths. This is important especially with NFS where number of slashes are not the same in the /proc/self/mountinfo and fstab or utab. The regular URI is euler://tmp but /proc contains euler:/tmp Reported-by: Ales Novak <alnovak@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix compiler warnings [-Wmissing-prototypes]Ruediger Meier2016-02-231-3/+3
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libmount: fix memleak in mnt_pretty_path()Karel Zak2016-02-121-0/+1
| | | | | References: https://github.com/karelzak/util-linux/issues/275 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove assert(arg) from public functionsKarel Zak2015-02-161-14/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup gtk-docs warningsKarel Zak2015-01-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: only invoke loopcxt on linuxAndreas Henriksson2014-09-221-0/+2
| | | | | | | | | This is part of an attempt to make libmount buildable on non-linux. The support for /dev/loop* is Linux-specific so just disable it on non-linux for now. Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* libmount: always use mnt_resolve_target() in mnt_fs_match_target()Karel Zak2014-07-011-0/+1
| | | | | | | The requested path is also target mountpoint, so let's optimize realpath() usage as well. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: mnt_resolve_target: tiptoe around active mount pointsEric Rannaud2014-07-011-19/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | Current code in mnt_fs_match_target() and mnt_table_find_target() already does not canonicalize active mount points (when read from mountinfo), because they are already canonicalized by the kernel. Calling realpath(fs->target) on a mount point can hang -- e.g. if the NFS server is unreachable. This patch optionally extends this strategy to the general case, that is when @fs does not directly come from the kernel through mountinfo (for instance, it may have been parsed from /etc/fstab). Given @mtab parsed from mountinfo, and if mnt_cache_set_targets(cache, mtab) is used, then mnt_fs_match_target() and mnt_table_find_target() check whether @fs->target is a known mount point in the cached mountinfo, before attempting to canonicalize @fs->target, no matter where @fs itself comes from. If found in the cached mountinfo, @fs->target is not canonicalized. [kzak@redhat.com: - don't allocate libmnt_iter, - add docs for mnt_cache_set_targets(), - fallback to mnt_resolve_path() if no cache->mtab specified, - use streq_except_trailing_slash() to compare paths] Signed-off-by: Eric Rannaud <e@nanocritical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: use new debug functionsKarel Zak2014-03-211-14/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add reference counter to libmnt_tableKarel Zak2013-08-211-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add reference counting to libmnt_cacheKarel Zak2013-08-211-3/+38
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix typosOndrej Oprala2013-08-051-8/+8
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* libmount: be more restrictive about valid tag namesKarel Zak2013-07-021-17/+12Star
| | | | | | | | | | # mount DUMMY=filename.img /mnt The 'DUMMY=filename.img' is a filename and should not be interpreted as tag name. The valid tag names are LABEL, UUID, PARTLABEL and PARTUUID only. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix __mnt_cache_find_tag_value() [coverity scan]Karel Zak2013-03-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: correctly propagate ambivalent blkid probing resultsKarel Zak2013-02-131-11/+33
| | | | | | | | libmount ignores "ambivalent probing result" from libblkid and tries filesystems /etc/filesystems. This is incorrect behavior. Reported-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add function attributes to private APIOndrej Oprala2012-11-301-1/+1
| | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix compiler warning [-Wsign-compare]Karel Zak2012-07-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/loopdev: use warn_unused_result forimportant functionsKarel Zak2012-06-211-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: make some string operations more robustKarel Zak2012-06-151-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: close device fd (to avoid mount(2) EBUSY)Karel Zak2012-04-271-53/+17Star
| | | | | | | | | | | | libmount uses libblkid to detect filesystem type. Unfortunately, the blkid probe struct is not freed before mount(2), it means that the device is still open and mount(2) may return EBUSY. We don't need persistent blkid stuff in libmount, so let's close all immediately after device probing. Reported-by: David Zeuthen <zeuthen@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add support for PARTUUID= and PARTLABEL=Karel Zak2012-04-191-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid: move cache to /run on new systemsKarel Zak2012-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Why? * read-only root * /etc is pretty bad place for caches * all is usually cached by udev in /dev/disk/by-* and libblkid is able to use these symlinks * boot persistent cache is attractive for very small subset of Linux machines (and they already need extra udev tunning otherwise udev will probe all block devices during boot) * the default is possible to override in /etc/blkid.conf The systems without /run directory will not be affected by this change. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix trivial typos in debugging outputPetr Uzel2011-11-091-1/+1
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* libmount: fix undefined sourcesDavidlohr Bueso2011-08-081-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | The path resolving function breaks when handling undefined sources ("none") used by pseudo-filesystems. The assertion is causing the samples/mount program to abort: dave@offbook:~/projects/util-linux-good/libmount/samples$ ./mount /dev/sda3 on / type ext4 (rw,errors=remount-ro,commit=0) proc on /proc type proc (rw,noexec,nosuid,nodev) lt-mount: cache.c:464: mnt_resolve_path: Assertion `path' failed. Aborted /etc/mtab: /dev/sda3 / ext4 rw,errors=remount-ro,commit=0 0 0 proc /proc proc rw,noexec,nosuid,nodev 0 0 none /sys sysfs rw,noexec,nosuid,nodev 0 0 fusectl /sys/fs/fuse/connections fusectl rw 0 0 none /sys/kernel/debug debugfs rw 0 0 ... Instead of this assert on NULL we can simply return NULL and let mnt_pretty_path do the work. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* libmount: fix compiler warnings [-Wunused-parameter -Wsign-compare]Karel Zak2011-08-021-6/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove unnecessary includes, mask API as stableKarel Zak2011-07-251-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup docsKarel Zak2011-07-231-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: allow to convert /dev/loopN to backing filenameKarel Zak2011-06-231-0/+51
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix fstype cachingKarel Zak2011-06-231-15/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rename in cache.cKarel Zak2011-06-231-16/+16
| | | | | | * don't use mnt_ prefix for static functions Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up cache.cKarel Zak2011-06-231-50/+51
| | | | | | * rename fields in the cache entry to be more readable... Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mount support for loopdevsKarel Zak2011-06-101-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libmount rather than shlibs/mountKarel Zak2011-06-091-0/+667
Signed-off-by: Karel Zak <kzak@redhat.com>