summaryrefslogtreecommitdiff
path: root/sys/ufs/ext2fs/ext2fs_inode.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2022-08-12 14:30:54 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2022-08-12 14:30:54 +0000
commitc5809ba8cfd83d3a6df37582a7645dc07eb9240e (patch)
tree7138877aee9c5073e1f77d3506a754eaabdd303e /sys/ufs/ext2fs/ext2fs_inode.c
parentbfa0919b6d8400e745b440c872c27eb4dfabd548 (diff)
Put more struct vnode fields under splbio().
Buffer cache related struct vnode fields can be accessed in interrupt context. Be more consistent with the use of splbio(). OK mpi@
Diffstat (limited to 'sys/ufs/ext2fs/ext2fs_inode.c')
-rw-r--r--sys/ufs/ext2fs/ext2fs_inode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c
index 5c76a5956b3..2962628f865 100644
--- a/sys/ufs/ext2fs/ext2fs_inode.c
+++ b/sys/ufs/ext2fs/ext2fs_inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_inode.c,v 1.65 2021/12/12 09:14:59 visa Exp $ */
+/* $OpenBSD: ext2fs_inode.c,v 1.66 2022/08/12 14:30:53 visa Exp $ */
/* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */
/*
@@ -387,10 +387,15 @@ done:
for (i = 0; i < NDADDR; i++)
if (newblks[i] != oip->i_e2fs_blocks[i])
panic("ext2fs_truncate2");
- if (length == 0 &&
- (!LIST_EMPTY(&ovp->v_cleanblkhd) ||
- !LIST_EMPTY(&ovp->v_dirtyblkhd)))
- panic("ext2fs_truncate3");
+ if (length == 0) {
+ int s;
+
+ s = splbio();
+ if (!LIST_EMPTY(&ovp->v_cleanblkhd) ||
+ !LIST_EMPTY(&ovp->v_dirtyblkhd))
+ panic("ext2fs_truncate3");
+ splx(s);
+ }
#endif /* DIAGNOSTIC */
/*
* Put back the real size.