summaryrefslogtreecommitdiffstats
path: root/libmount/src/fs.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/fs.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/fs.c')
-rw-r--r--libmount/src/fs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c
index 22addb9f4..543ffb153 100644
--- a/libmount/src/fs.c
+++ b/libmount/src/fs.c
@@ -1208,7 +1208,8 @@ int mnt_fs_get_attribute(struct libmnt_fs *fs, const char *name,
* Possible are three attempts:
* 1) compare @target with @fs->target
* 2) realpath(@target) with @fs->target
- * 3) realpath(@target) with realpath(@fs->target).
+ * 3) realpath(@target) with realpath(@fs->target) if @fs is not from
+ * /proc/self/mountinfo.
*
* The 2nd and 3rd attempts are not performed when @cache is NULL.
*
@@ -1231,7 +1232,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target,
rc = (cn && strcmp(cn, fs->target) == 0);
/* 3) - canonicalized and canonicalized */
- if (!rc && cn) {
+ if (!rc && cn && !mnt_fs_is_kernel(fs)) {
char *tcn = mnt_resolve_path(fs->target, cache);
rc = (tcn && strcmp(cn, tcn) == 0);
}