blob: 86e53c3effc65f9e93a5a7043879416853f0157e [file] [log] [blame] [raw]
Allow a FUSE root vnode (the mountpoint) to be a non-directory.
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/fs/fuse/fuse_vnops.c freebsd-11.1/sys/fs/fuse/fuse_vnops.c
--- /usr/src/sys/fs/fuse/fuse_vnops.c 2017-07-21 07:42:02.000000000 +0800
+++ freebsd-11.1/sys/fs/fuse/fuse_vnops.c 2020-01-26 13:58:28.518773000 +0800
--- /usr/src/sys/fs/fuse/fuse_vnops.c 2017-07-21 07:42:02.000000000 +0800
+++ /tmp/fuse_vnops.c 2020-01-26 14:01:53.730754000 +0800
@@ -510,9 +510,14 @@
memcpy(vap, VTOVA(vp), sizeof(*vap));
}
if (vap->va_type != vnode_vtype(vp)) {
- fuse_internal_vnode_disappear(vp);
- err = ENOENT;
- goto out;
+ if(vnode_isdir(vp) && vnode_isvroot(vp)) {
+ debug_printf("updating root vnode type to %d\n", vap->va_type);
+ vp->v_type = vap->va_type;
+ } else {
+ fuse_internal_vnode_disappear(vp);
+ err = ENOENT;
+ goto out;
+ }
}
if ((fvdat->flag & FN_SIZECHANGE) != 0)
vap->va_size = fvdat->filesize;