summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
Commit message (Collapse)AuthorAgeFilesLines
* libmount: (docs) add reference to v2.33 and v2.34Karel Zak2019-06-071-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: improve fs referencing in tablesTim Hildering2019-03-081-9/+11
| | | | | | | | | | | | | | | * Added member 'struct libmnt_table *tab' to libmnt_fs structure. * Added 'mnt_fs_get_table()'. * Removed overhead from 'mnt_table_{insert,move,remove}_fs(). * Added check to 'mnt_table_set_iter()' that entry is member of table. [kzak@redhat.com: - add to libmount.sys - add to docs - cleanup commit message - set fs->tab = NULL before mnt_unref_fs() in mnt_table_remove_fs()] Signed-off-by: Tim Hildering <hilderingt@posteo.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_{find,insert,move}_fs()Karel Zak2019-02-211-3/+169
| | | | | | | | Add functions to insert FS into table to specified position and to move FS between two tables. Co-Author: Tim Hildering <hilderingt@posteo.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: check table membership before adding entryTim Hildering2019-02-181-0/+3
| | | | | | | Added validation to function 'mnt_table_add_fs()' to check that added @fs is not already a member of another table. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup licenses sections in the filesKarel Zak2018-08-161-3/+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>
* libmount: fix mnt_table_is_fs_mounted() for NFS bind mounts.NeilBrown2018-04-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | When you bind-mount a subdirectory of a local filesystem, the path to that subdirectory appears as the fourth field in mountinfo. For nfs mounts, the fourth field is always "/", and the subdirectory part is appended to the "special" (aka "device") field. This is consistent with historical NFS usage which always includes a path in the fs_spec field. libmount needs to know about this when "mount -a" checks to see if a filesystem is already mounted. Without this fix, fstab lines like: server::/path /dir nfs defaults 0 0 /dir/subdir /mnt/test none bind 0 0 result in a new mount at /mnt/test every time "mount -a" is run. [kzak@redhat.com: - use strappend() rather than asprintf()] Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mnt_table_is_fs_mounted() for rbindKarel Zak2018-01-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no difference between "bind" and "rbind" if we want to FS root to search for the FS in mountinfo file. fstab: /dev/sdc1 /mnt/foo xfs defaults 0 0 /mnt/foo /mnt/test none rw,rbind 0 0 use -a more than once: mount -a mount -a /proc/mounts (the current result): /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 expected (fixed version) result: /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1528959 Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix warning "set but not used"Ruediger Meier2017-06-151-4/+2Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libmount: cosmetic change to mnt_table_find_srcpath()Karel Zak2017-02-281-6/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: return tab entry for default nodePetr Vorel2017-02-281-1/+28
| | | | | | This is useful for lsblk. Signed-off-by: Petr Vorel <pvorel@suse.cz>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|
* libmount: make rootfs lookup by parent-id more robustKarel Zak2017-02-011-4/+30
| | | | | | | The root FS id really does not have to be the smallest one. Reported-by: Michal Soltys <soltys@ziu.info> Signed-off-by: Karel Zak <kzak@redhat.com>
* findmnt: error on --target /non-existKarel Zak2016-12-161-0/+4
| | | | | | | | | | | | | | | The original --target implementation (< v2.27) has been based on stat(), so it was usable for valid paths only. The new implementation is based on search in the mountinfo file, so it works for arbitrary crazy path. This is not backwardly compatible and if the path does not exist then it still returns at least root directory mount entry. This patch forces mnt_table_find_mountpoint() to check if the path is valid before we search in the mountinfo file. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: paranoid change in mnt_table_is_fs_mounted()Karel Zak2016-09-291-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mount -a for cifsAurelien Aptel2016-09-291-3/+24
| | | | | | | | | | | | | when mounting a cifs share, the src is actually an UNC path which can in in several forms: simple: //host/share, //host/share/ including subpath: //host/share/sub/path to check if the cifs fs is mounted we have to extract the subpath and compare *that* to the root. Signed-off-by: Aurelien Aptel <aaptel@suse.com>
* Add sizelimit to internal APIStanislav Brabec2016-08-031-1/+1
| | | | | | | | | | | | | | Fully safe checks of loop device need to check sizelimit. To prevent need of two nearly equal functions, introduce sizelimit parameter to several internal functions: loopdev_is_used() loopdev_find_by_backing_file() loopcxt_is_used() loopcxt_find_by_backing_file() If sizelimit is zero, fall back to the old behavior (ignoring of sizelimit). Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* misc: Fix various typosSebastian Rasmussen2016-05-311-4/+4
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* libmount: remove duplicate codeKarel Zak2016-04-221-24/+2Star
| | | | | | | | For petty long time we have strdup_to_struct_member() macro to avoid duplicate code when strdup() strings in setter functions. Let's use it for libmount. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: try absolute target before canonicalizeKarel Zak2016-04-131-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The path canonicalization is expensive and in many cases unwanted due to problems with readlink() on unreachable NFS and automounters. This patch add a possibility to search also by $(CWD)/<path> if the <path> is relative to reduce number of situation when we convert the path to the canonical absolute path. The common use-case: # cd /some/long/path # umount ./mountpoint old version: 15543: libmount: TAB: [0x560a99a54230]: lookup TARGET: './test' 15543: libmount: CACHE: [0x560a99a54290]: canonicalize path ./test 15543: libmount: CACHE: [0x560a99a54290]: add entry [ 1] (path): /mnt/test: ./test 15543: libmount: TAB: [0x560a99a54230]: lookup canonical TARGET: '/mnt/test' 15543: libmount: CXT: [0x560a99a54050]: umount fs: /mnt/test new version: 15597: libmount: TAB: [0xabf230]: lookup TARGET: './test' 15597: libmount: TAB: [0xabf230]: lookup absolute TARGET: '/mnt/test' 15597: libmount: CXT: [0xabf050]: umount fs: /mnt/test Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: Fix possible NULL dereference in get_btrfs_fs_root()Karel Zak2016-03-311-1/+3
| | | | | | | | | | | The function mnt_table_get_fs_root() should be robust enough to accept NULL as mountinfo -- the right behaviour is to default to '/'. The set_fs_root() (tab_update.c) has to understand when mountinfo is necessary (for bind mounts and btrfs). Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix icc/clang compiler warningsRuediger Meier2016-03-131-3/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | clang warning: libmount/src/tab.c:1833:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!mpc) ^~~~ icc printf warnings: libmount/src/monitor.c(348): warning #2279: printf/scanf format not a string literal and no format arguments DBG(MONITOR, ul_debugobj(mn, status == 1 ? " success" : " nothing")); ^ login-utils/vipw.c(348): warning #2279: printf/scanf format not a string literal and no format arguments : _("You are using shadow passwords on this system.\n")); ^ icc enum warnings: disk-utils/fdisk-menu.c(150): warning #188: enumerated type mixed with another type .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD, ^ libsmartcols/src/table_print.c(750): warning #188: enumerated type mixed with another type &width, align, ^ Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libmount: Typo fixStanislav Brabec2016-03-101-2/+2
|
* tests: fix compiler warnings [-Wmissing-prototypes]Ruediger Meier2016-02-231-8/+8
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libmount: fix mnt_table_is_fs_mounted() loopdev useKarel Zak2016-02-161-14/+19
| | | | | | | | | | The function does not detect already mounted loop devices on systems with regular /etc/mtab file. The patch also improves test_is_mounted() to be useful with mtab. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix mnt_table_is_fs_mounted() for loopdevKarel Zak2016-02-121-4/+8
| | | | | Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: move btrfs subvol code refactoringKarel Zak2016-02-011-99/+115
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix target resolving for btrfs stuffKarel Zak2016-02-011-9/+14
| | | | | | and make the code more verbose. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: code re-indentationStanislav Brabec2016-02-011-43/+44
| | | | | | | | | | For easier review, the fix of libmount comes in two patches: PATCH 1/2: libmount: run btrfs subvol checks for "subvolid" option PATCH 2/2: code re-indentation No code change is present in this patch. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* libmount: run btrfs subvol checks for "subvolid" optionStanislav Brabec2016-02-011-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible to identify btrfs subvolume with "subvolid" instead of "subvol". In such case, btrfs specific check mistakenly assumes that the default subvolume is going to be mounted, even if subvolid specifies id of non-default subvolume. Implement a code for "subvolid" option. For easier review, this fix comes in two patches: PATCH 1/2: libmount: run btrfs subvol checks for "subvolid" option PATCH 2/2: code re-indentation How to reproduce: truncate -s1G btrfs_test.img mkdir -p btrfs_mnt /sbin/mkfs.btrfs -f -d single -m single ./btrfs_test.img mount -o loop btrfs_test.img btrfs_mnt pushd . cd btrfs_mnt mkdir -p d0/dd0/ddd0 cd d0/dd0/ddd0 touch file{1..5} btrfs subvol create s1 cd s1 touch file{1..5} mkdir -p d1/dd1/ddd1 cd d1/dd1/ddd1 btrfs subvol create s2 rid=$(btrfs inspect rootid s2) echo new default $rid btrfs subvol get-default . btrfs subvol set-default $rid . popd DEFAULT_SUBVOLID=`btrfs subvolume get-default btrfs_mnt | while read dummy id rest ; do echo $id ; done` NON_DEFAULT_SUBVOLID=`btrfs subvolume list btrfs_mnt | while read dummy id rest ; do if test $id = $DEFAULT_SUBVOLID ; then continue ; fi ; echo $id ; done` umount btrfs_mnt losetup /dev/loop0 $PWD/btrfs_test.img echo "/dev/loop0 $PWD/btrfs_mnt btrfs subvolid=$NON_DEFAULT_SUBVOLID 0 0" >>/etc/fstab ./mount -a ./mount -a umount btrfs_mnt sed -i "/\/dev\/loop0/d" /etc/fstab losetup -d /dev/loop0 rm btrfs_test.img rmdir btrfs_mnt Current behavior of second "mount -a": mount: /dev/loop0 is already mounted or /root/btrfs_mnt busy /dev/loop0 is already mounted on /root/btrfs_mnt Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* libmount: run btrfs subvol checks for "auto" fs typeStanislav Brabec2016-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible to mount btrfs using "auto" keyword in fstab. In such case, btrfs specific checks are skipped. Run them for "auto" as well. Looking at the code, it is a safe approach. In case of btrfs, it will do what is needed, in case of no btrfs, btrfs_get_default_subvol_id() will fail, and the rest of the code is skipped. How to reproduce: See reproducer in 2cd28fc and replace fstab line by echo "/dev/loop0 $PWD/btrfs_mnt btrfs auto 0 0" >>/etc/fstab Current behavior of second "mount -a": mount: /dev/loop0 is already mounted or /root/btrfs_mnt busy /dev/loop0 is already mounted on /root/btrfs_mnt Testcases for btrfs and ext4: truncate -s1G btrfs_test.img truncate -s1G ext4_test.img mkdir -p btrfs_mnt mkdir -p ext4_mnt /sbin/mkfs.btrfs -f -d single -m single ./btrfs_test.img /sbin/mkfs.ext4 ./ext4_test.img losetup /dev/loop0 $PWD/btrfs_test.img losetup /dev/loop1 $PWD/ext4_test.img echo "/dev/loop0 $PWD/btrfs_mnt auto defaults 0 0" >>/etc/fstab echo "/dev/loop1 $PWD/ext4_mnt auto defaults 0 0" >>/etc/fstab ./mount -a ./mount -a umount btrfs_mnt umount ext4_mnt sed -i "/\/dev\/loop[01]/d" /etc/fstab losetup -d /dev/loop0 losetup -d /dev/loop1 rm btrfs_test.img rm ext4_test.img rmdir btrfs_mnt rmdir ext4_mnt Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* libmount: consolidate btrfs stuff, make it more portableKarel Zak2016-01-261-0/+3
| | | | | | | | | - add --with-btrfs (enabled by default) - check for linux/btrfs.h - add "btrfs" to libmount features list (see mount -V) - #ifdef HAVE_BTRFS_SUPPORT for all btrfs stuff in libmount Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: handle btrfs default subvolume mountStanislav Brabec2016-01-261-4/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mounting btrfs volume without subvol= and subvolid=, and the btrfs volume has default subvolume defined, mount() mounts the default subvolume and not the volume root as other filesystems do. To handle this situation correctly (for example for "mount -a"), libmount has to be capable to detect default subvolume. Add btrfs.c and btrfs.h that implement needed functions. This patch adds mnt_table_find_target_with_option() to the library API. Known problems not covered by this patch: - Use of subvolid= in fstab is not yet handled. - Use of type auto in combination with subvol= in fstab is not yet handled. - Use of btrfs in loop devices, where image file is specified in fstab is not yet handled (use of /dev/loop0 in fstab works). - If fstab uses subvol=, and subvol path changes since last "mount -a", subsequent "mount -a" will not recognize that it is already mounted, and it will attempt to mount it second time. To fix it, libmount should remember subvolid in time of mount (subvolid is unique for the subvolume, subvol is not). - mountinfo contains subvol and subvolid since kernel 4.2. Before kernel 4.2, there is no reasonable way to solve this situation. (One would create temporary mount point, mount the default, call needed ioctl() to determine what was mounted, deduce the default subvolume, compare it with subvolume of mounted volume, unmount and return result.) How to reproduce: truncate -s1G btrfs_test.img mkdir -p btrfs_mnt /sbin/mkfs.btrfs -f -d single -m single ./btrfs_test.img mount -o loop btrfs_test.img btrfs_mnt pushd . cd btrfs_mnt mkdir -p d0/dd0/ddd0 cd d0/dd0/ddd0 touch file{1..5} btrfs subvol create s1 cd s1 touch file{1..5} mkdir -p d1/dd1/ddd1 cd d1/dd1/ddd1 btrfs subvol create s2 rid=$(btrfs inspect rootid s2) echo new default $rid btrfs subvol get-default . btrfs subvol set-default $rid . popd umount btrfs_mnt losetup /dev/loop0 $PWD/btrfs_test.img echo "/dev/loop0 $PWD/btrfs_mnt btrfs defaults 0 0" >>/etc/fstab mount -a mount -a umount btrfs_mnt sed -i "/\/dev\/loop0/d" /etc/fstab losetup -d /dev/loop0 rm btrfs_test.img rmdir btrfs_mnt Current behavior: mount: /dev/loop0 is already mounted or /root/btrfs_mnt busy /dev/loop0 is already mounted on /root/btrfs_mnt Expected behavior is to ignore already mounted FS. [kzak@redhat.com: - make 'var' optional for mnt_table_find_target_with_option(), - add mnt_table_find_target_with_option() to symbols table and docs - add "btrfs" string between supported debug modes - minor coding style changes] Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Cc: David Štěrba <dsterba@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix is-mounted check for btrfsKarel Zak2015-12-021-12/+26
| | | | | | | | | | | fstab: /dev/sdc /mnt/test btrfs subvol=/anydir /mnt/test /mnt/test2 auto bind and "mount -a" does not detect that /mnt/test2 is already mounted. Reported-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix shadow declarationsSami Kerola2015-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | sys-utils/zramctl.c: In function 'get_mm_stat': sys-utils/zramctl.c:276:58: warning: declaration of 'inbytes' shadows a global declaration [-Wshadow] static char *get_mm_stat(struct zram *z, size_t idx, int inbytes) sys-utils/zramctl.c:119:39: note: shadowed declaration is here static unsigned int raw, no_headings, inbytes; libmount/src/tab.c: In function 'mnt_table_get_fs_root': libmount/src/tab.c:1221:22: warning: declaration of 'fs' shadows a parameter [-Wshadow] struct libmnt_fs *fs = mnt_table_find_mountpoint(tb, libmount/src/tab.c:1197:24: note: shadowed declaration is here struct libmnt_fs *fs, disk-utils/fsck.minix.c: In function 'main': disk-utils/fsck.minix.c:1364:17: warning: declaration of 'i' shadows a previous local [-Wshadow] unsigned long i, free; disk-utils/fsck.minix.c:1250:6: note: shadowed declaration is here int i; Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: cleanup assert() usageKarel Zak2015-08-041-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup fs root detection codeKarel Zak2015-03-101-6/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove assert(arg) from public functionsKarel Zak2015-02-161-58/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: read utab always when read mtab from /procKarel Zak2015-02-121-1/+1
| | | | | | | | | | | | | Now libmount reads utab only when mtab filename is no explicitly specified, but for example: mnt_table_parse_mtab(tb, "/proc/self/mountinfo"); ignores utab because filename points to regular file. This is mistake, we wnat to read utab always when we read mount table from kernel. Reported-by: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't return root if path contains // or ending /Søren Holm2014-10-011-1/+1
| | | | | | | | If the path fx. is /foo/bar/ the initial stripoff will replace the last slash with \0 and return a pointer to that exact \0 character. The same thing will happen if the path contains // somewhere. Signed-off-by: Søren Holm <sgh@sgh.dk>
* 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>
* textual: fix some typosSami Kerola2014-07-131-1/+1
| | | | | | | Found with misspell-check version 2.0d. Reference: https://github.com/lyda/misspell-check Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: mnt_resolve_target: tiptoe around active mount pointsEric Rannaud2014-07-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lib/fileutils: add stripoff_last_component() from libmountKarel Zak2014-06-091-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: silence some docs warningsOndrej Oprala2014-03-281-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* libmount: use new debug functionsKarel Zak2014-03-211-33/+31Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: FS id and parent ID could be zeroKarel Zak2014-02-201-8/+4Star
| | | | | | | | | | It seems that linux 3.14 is able to produce things like: 19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered ^ Reported-by: Mantas Mikulėnas <grawity@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: initialize *root to NULL in mnt_table_get_root_fsThomas Bächler2014-02-171-0/+2
| | | | | | | | mnt_table_get_root_fs only works when *root is set to NULL. This is not only undocumented, but also unintuitive. Fix it by initializing *root inside mnt_table_get_root_fs. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_uniq_fs()Karel Zak2013-12-111-14/+147
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: update docsKarel Zak2013-09-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup libmnt_fs list after mnt_table_remove_fs()Karel Zak2013-08-221-0/+3
| | | | | | | .. otherwise mnt_free_fs() will try to remove FS from non-existing list. Signed-off-by: Karel Zak <kzak@redhat.com>