From: natano Date: Mon, 15 Aug 2016 07:39:46 +0000 (+0000) Subject: Neuter fuse_vptofh() and fuse_fhtovp(). I implemented those functions X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=514c5354f8853d80251752aa2b39dc8d690f0ded;p=openbsd Neuter fuse_vptofh() and fuse_fhtovp(). 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 inode numbers to a handle at all (see struct fuse_operations). ok guenther --- diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index 162860c2067..9780f0760f1 100644 --- a/sys/miscfs/fuse/fuse_vfsops.c +++ b/sys/miscfs/fuse/fuse_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vfsops.c,v 1.25 2016/08/13 11:42:46 natano Exp $ */ +/* $OpenBSD: fuse_vfsops.c,v 1.26 2016/08/15 07:39:46 natano Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon * @@ -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