]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: mnt_resolve_path: don't canonicalize fs->target for swap
authorEric Rannaud <e@nanocritical.com>
Fri, 27 Jun 2014 05:17:17 +0000 (22:17 -0700)
committerKarel Zak <kzak@redhat.com>
Tue, 1 Jul 2014 07:32:12 +0000 (09:32 +0200)
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>
libmount/src/fs.c

index 949e718f4ca5365ce489f085cbbab49b46ef41a6..21ef0f7479fd1455d0d8df5c8695359324a6cefa 100644 (file)
@@ -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);
                }