summaryrefslogtreecommitdiffstats
path: root/fs/fuse/virtio_fs.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-04-21 14:47:15 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2020-10-09 16:33:47 +0200
commitbf109c64040f5b6bfe8a7044667e11d62dff6d91 (patch)
tree92e8c2520d36e92b500e82294d0e4259a0a77d8d /fs/fuse/virtio_fs.c
parent1866d779d5d2abae59d304e809600ca3ca8d0071 (diff)
downloadlinux-bf109c64040f5b6bfe8a7044667e11d62dff6d91.tar.bz2
fuse: implement crossmounts
FUSE servers can indicate crossmount points by setting FUSE_ATTR_SUBMOUNT in fuse_attr.flags. The inode will then be marked as S_AUTOMOUNT, and the .d_automount implementation creates a new submount at that location, so that the submount gets a distinct st_dev value. Note that all submounts get a distinct superblock and a distinct st_dev value, so for virtio-fs, even if the same filesystem is mounted more than once on the host, none of its mount points will have the same st_dev. We need distinct superblocks because the superblock points to the root node, but the different host mounts may show different trees (e.g. due to submounts in some of them, but not in others). Right now, this behavior is only enabled when fuse_conn.auto_submounts is set, which is the case only for virtio-fs. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/virtio_fs.c')
-rw-r--r--fs/fuse/virtio_fs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 746fa1a40975..5200ad50ed10 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -1431,6 +1431,7 @@ static int virtio_fs_get_tree(struct fs_context *fsc)
&virtio_fs_fiq_ops, fs);
fc->release = fuse_free_conn;
fc->delete_stale = true;
+ fc->auto_submounts = true;
fsc->s_fs_info = fm;
sb = sget_fc(fsc, virtio_fs_test_super, virtio_fs_set_super);