While I can understand that ext2fs is using ufs_ihashget() I'm still
authorclaudio <claudio@openbsd.org>
Wed, 11 Sep 2024 08:29:55 +0000 (08:29 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 11 Sep 2024 08:29:55 +0000 (08:29 +0000)
flabbergasted by the abuse from fuse.

For whatever dumb reason fuse uses the ufs inode instead of having its
own much simpler struct. Again this is a workaround to not crash when
fuse is used.

OK beck@

sys/ufs/ufs/ufs_ihash.c

index 3e29936..1c31867 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ufs_ihash.c,v 1.29 2024/09/10 12:14:26 claudio Exp $  */
+/*     $OpenBSD: ufs_ihash.c,v 1.30 2024/09/11 08:29:55 claudio Exp $  */
 /*     $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $   */
 
 /*
@@ -109,10 +109,25 @@ loop:
                        * the previously committed vdoom() or this should be
                        * dealt with so this can't happen.
                        */
+#ifdef FUSE
+                       /*
+                        * XXX for whatever stupid reason fuse decided to
+                        * use ufs inodes and with this ufs_ihashget.
+                        * fuse needs to grow up and use its own inode
+                        * structure and hash.
+                        */
+                       if (vp->v_tag == VT_FUSEFS)
+                               return (vp);
+#endif
                        if (VTOI(vp) != ip ||
                            ((
 #ifdef EXT2FS
-                           IS_EXT2_VNODE(ip->i_vnode) ? ip->i_e2fs_nlink <= 0 :
+                           /*
+                            * XXX DIP does not cover ext2fs so hack
+                            * around this for now since this is using
+                            * ufs_ihashget as well.
+                            */
+                           IS_EXT2_VNODE(vp) ? ip->i_e2fs_nlink <= 0 :
 #endif
                            DIP(ip, nlink) <= 0) &&
                             (vp->v_mount->mnt_flag & MNT_RDONLY) == 0)) {