After staring a couple of days at fusefs and libfuse code I came to the
conclusion, that the fuse_vptofh() and fuse_fhtovp() functions must die.
I implemented those functions under the assumption, that fuse_vget() has
reasonable semantics, while this is not the case. fusefs_vget() only
functions correctly, if the file in questions has recently been accessed
and is still in the vnode cache of the userspace daemon associated with
the mount point.

As a matter of fact the fuse api doesn't feature a reasonable way to map
a inode number to a handle at all (see struct fuse_operations).

I don't this this will be missed, as the only thing in base using it is
nfs and the getfh/fhstat/fhopen functions which are not used in base
apart from nfs support code.

Ok?


Index: miscfs/fuse/fuse_vfsops.c
===================================================================
RCS file: /cvs/src/sys/miscfs/fuse/fuse_vfsops.c,v
retrieving revision 1.25
diff -u -p -r1.25 fuse_vfsops.c
--- miscfs/fuse/fuse_vfsops.c   13 Aug 2016 11:42:46 -0000      1.25
+++ miscfs/fuse/fuse_vfsops.c   14 Aug 2016 14:34:54 -0000
@@ -300,28 +300,13 @@ retry:
 int
 fusefs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
 {
-       struct ufid *ufhp;
-
-       ufhp = (struct ufid *)fhp;
-       if (ufhp->ufid_len != sizeof(struct ufid) ||
-           ufhp->ufid_ino < FUSE_ROOTINO)
-               return (ESTALE);
-
-       return (VFS_VGET(mp, ufhp->ufid_ino, vpp));
+       return (EINVAL);
 }
 
 int
 fusefs_vptofh(struct vnode *vp, struct fid *fhp)
 {
-       struct fusefs_node *ip;
-       struct ufid *ufhp;
-
-       ip = VTOI(vp);
-       ufhp = (struct ufid *)fhp;
-       ufhp->ufid_len = sizeof(struct ufid);
-       ufhp->ufid_ino = ip->ufs_ino.i_number;
-
-       return (0);
+       return (EINVAL);
 }
 
 int

Reply via email to