From afd0874b66f39f0f1ca8887afcb542877efdb1d3 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Wed, 11 Sep 2024 08:29:56 +0000 Subject: While I can understand that ext2fs is using ufs_ihashget() I'm still 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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c index 3e299361a5b..1c31867e876 100644 --- a/sys/ufs/ufs/ufs_ihash.c +++ b/sys/ufs/ufs/ufs_ihash.c @@ -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)) { -- cgit v1.2.3