diff options
author | Eric Rannaud | 2014-06-27 07:17:17 +0200 |
---|---|---|
committer | Karel Zak | 2014-07-01 09:32:12 +0200 |
commit | 45e8cdba91799c4149c9c7f20bfa7606bf295f7f (patch) | |
tree | 867d612e720035d51c77b5c9d995bc1236cac48a /libmount/src/fs.c | |
parent | libmount: mnt_resolve_path: use strcmp() only if both are canonical (diff) | |
download | kernel-qcow2-util-linux-45e8cdba91799c4149c9c7f20bfa7606bf295f7f.tar.gz kernel-qcow2-util-linux-45e8cdba91799c4149c9c7f20bfa7606bf295f7f.tar.xz kernel-qcow2-util-linux-45e8cdba91799c4149c9c7f20bfa7606bf295f7f.zip |
libmount: mnt_resolve_path: don't canonicalize fs->target for swap
This is how mnt_table_find_target() does it. It makes sense because
@fs->target is "none" for swap and is never a sensible match for a
user-specified target.
Signed-off-by: Eric Rannaud <e@nanocritical.com>
Diffstat (limited to 'libmount/src/fs.c')
-rw-r--r-- | libmount/src/fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c index 949e718f4..21ef0f747 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -1437,7 +1437,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target, rc = (cn && mnt_fs_streq_target(fs, cn)); /* 3) - canonicalized and canonicalized */ - if (!rc && cn && !mnt_fs_is_kernel(fs)) { + if (!rc && cn && !mnt_fs_is_kernel(fs) && !mnt_fs_is_swaparea(fs)) { char *tcn = mnt_resolve_path(fs->target, cache); rc = (tcn && strcmp(cn, tcn) == 0); } |