From: Eric Rannaud Date: Fri, 27 Jun 2014 05:17:17 +0000 (-0700) Subject: libmount: mnt_resolve_path: don't canonicalize fs->target for swap X-Git-Tag: v2.25-rc2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45e8cdba91799c4149c9c7f20bfa7606bf295f7f;p=thirdparty%2Futil-linux.git 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 --- diff --git a/libmount/src/fs.c b/libmount/src/fs.c index 949e718f4c..21ef0f7479 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); }