From 6f8114adcc0996ae8eb4b808b85595ef25139a69 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 20 May 2019 20:54:09 +0000 Subject: [PATCH] fusefs: unset MNT_LOCAL The kernel can't tell whether or not a fuse file system is truly local. But what really matters is two things: 1) Can I/O to a file system block indefinitely? 2) Can the file system bypass the O_BENEATH restriction during lookup? For fuse, the answer to both of those question is yes. So as far as the kernel is concerned, it's a non-local file system. Sponsored by: The FreeBSD Foundation --- sys/fs/fuse/fuse_vfsops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 230084c9554a..cd1358e2b3db 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -335,7 +335,11 @@ fuse_vfsop_mount(struct mount *mp) vfs_getnewfsid(mp); MNT_ILOCK(mp); mp->mnt_data = data; - mp->mnt_flag |= MNT_LOCAL; + /* + * FUSE file systems can be either local or remote, but the kernel + * can't tell the difference. + */ + mp->mnt_flag &= ~MNT_LOCAL; mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */