blob: a05c92a7d4c58675734d55dccbfc013bfac408e2 [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 /var/archive3/public/freebsd-releng-10.4-src/sys/fs/fuse/fuse_vnops.c freebsd-10.4/sys/fs/fuse/fuse_vnops.c
--- /var/archive3/public/freebsd-releng-10.4-src/sys/fs/fuse/fuse_vnops.c 2017-09-29 08:20:06.000000000 +0800
+++ freebsd-10.4/sys/fs/fuse/fuse_vnops.c 2020-01-16 19:30:40.907091000 +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;