From 675768db7d0235ae28763456e2f61ee38bb15b3f Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 10 Sep 2024 12:14:26 +0000 Subject: [PATCH] ufs_ihashget() is also used by the ext2fs code but the DIP() makro does not handle that. So for now add an ugly hack here to support ext2fs. This fixes access to ext2fs after the last commit. A better fix can be implemented in tree. Reported and OK anton@ --- sys/ufs/ufs/ufs_ihash.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c index b0d6ca3a5dd..3e299361a5b 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.28 2024/09/04 17:00:08 beck Exp $ */ +/* $OpenBSD: ufs_ihash.c,v 1.29 2024/09/10 12:14:26 claudio Exp $ */ /* $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $ */ /* @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -109,7 +110,11 @@ loop: * dealt with so this can't happen. */ if (VTOI(vp) != ip || - (DIP(ip, nlink) <= 0 && + (( +#ifdef EXT2FS + IS_EXT2_VNODE(ip->i_vnode) ? ip->i_e2fs_nlink <= 0 : +#endif + DIP(ip, nlink) <= 0) && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0)) { /* * This should recycle the inode immediately, -- 2.20.1