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>
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)
*/