blob: 96f5bc0b7f222657c07d926a23b4d0116d236246 [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 2019-11-08 13:46:29.832573000 +0800
@@ -510,9 +510,15 @@
memcpy(vap, VTOVA(vp), sizeof(*vap));
}
if (vap->va_type != vnode_vtype(vp)) {
- fuse_internal_vnode_disappear(vp);
- err = ENOENT;
- goto out;
+ debug_printf("vap->va_type = %d, vnode_vtype(vp) = %d\n", vap->va_type, vnode_vtype(vp));
+ if(vnode_vtype(vp) == VDIR && 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;