summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
diff options
context:
space:
mode:
authorKarel Zak2012-05-17 12:10:43 +0200
committerKarel Zak2012-05-17 12:10:43 +0200
commitfa705b5441bdb93c36702f7db6c54ec1133bd1cc (patch)
tree6c45c116641a7578132ee275c6f0091312ea6159 /libmount/src/tab.c
parenttext-utils: cleanup strtoxx_or_err() (diff)
downloadkernel-qcow2-util-linux-fa705b5441bdb93c36702f7db6c54ec1133bd1cc.tar.gz
kernel-qcow2-util-linux-fa705b5441bdb93c36702f7db6c54ec1133bd1cc.tar.xz
kernel-qcow2-util-linux-fa705b5441bdb93c36702f7db6c54ec1133bd1cc.zip
libmount: don't canonicalize target
Note that mountpoint (target_ paths in /proc/mounts and /proc/self/mountinfo are always canonicalized by kernel. * for umount we don't have to canonicalize target by default if the mountpoint is found in /proc/self/mountinfo * in mnt_table_find_target() is unnecessary to canonicalize target paths if the table of the filesystems is read from /proc/self/mountinfo Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=820707 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r--libmount/src/tab.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 9c41c99a2..927e0f8da 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -456,13 +456,18 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat
return fs;
}
- /* non-canonicaled path in struct libmnt_table */
+ /* non-canonicaled path in struct libmnt_table
+ * -- note that mountpoint in /proc/self/mountinfo is already
+ * canonicalized by kernel
+ */
mnt_reset_iter(&itr, direction);
while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
char *p;
- if (!fs->target || mnt_fs_is_swaparea(fs) ||
- (*fs->target == '/' && *(fs->target + 1) == '\0'))
+ if (!fs->target
+ || mnt_fs_is_swaparea(fs)
+ || mnt_fs_is_kernel(fs)
+ || (*fs->target == '/' && *(fs->target + 1) == '\0'))
continue;
p = mnt_resolve_path(fs->target, tb->cache);