]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: avoid resolving pseudofs source on update
authorDave Reisner <d@falconindy.com>
Mon, 26 Dec 2011 22:10:23 +0000 (17:10 -0500)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Jan 2012 13:27:09 +0000 (14:27 +0100)
Similar to the previous commit, when mounting a pseudofs, trust the
source of the fs, as it cannot be matched to backing device on the
filesystem.

Similar situation, but slightly different bug:

  # mkdir /foo /root/foo
  # echo 'foo  /foo  tmpfs  defaults  0  0' >> /etc/fstab
  # cd /root
  # mount -a
  # mount | grep /foo
  /root/foo on /foo type tmpfs (rw,relatime)

This fixes the pure libmount based mount utility, but the legacy mount
tool will still fail to handle this properly.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index c61a144736411f65abae73c07e2728796b7e7b7f..7dc4731847edaab10e332666e31e0029aa869d1b 100644 (file)
@@ -1101,7 +1101,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
 
                rc = path ? mnt_fs_set_source(cxt->fs, path) : -EINVAL;
 
-       } else if (cache) {
+       } else if (cache && !(cxt->fs->flags & MNT_FS_PSEUDO)) {
                /*
                 * Source is PATH (canonicalize)
                 */