diff options
author | Karel Zak | 2011-09-13 22:59:39 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-13 22:59:39 +0200 |
commit | 277a6dd53569a409e05316a7bdaed0e78e326762 (patch) | |
tree | 1ef664efe4a1452eb36fee0bb74857161242bfbf | |
parent | lib: do not attempt to close(0) in sysfs_deinit() (diff) | |
download | kernel-qcow2-util-linux-277a6dd53569a409e05316a7bdaed0e78e326762.tar.gz kernel-qcow2-util-linux-277a6dd53569a409e05316a7bdaed0e78e326762.tar.xz kernel-qcow2-util-linux-277a6dd53569a409e05316a7bdaed0e78e326762.zip |
mount: check for target before source on remount
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=737091
Reported-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | mount/fstab.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mount/fstab.c b/mount/fstab.c index 8d88f680d..77bf81cb9 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -272,10 +272,15 @@ getmntfilebackward (const char *name, struct mntentchn *mcprev) { mc0 = mtab_head(); if (!mcprev) mcprev = mc0; + for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev) - if (streq(mc->m.mnt_dir, name) || - streq(mc->m.mnt_fsname, name)) + if (streq(mc->m.mnt_dir, name)) return mc; + + for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev) + if (streq(mc->m.mnt_fsname, name)) + return mc; + return NULL; } |