Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Better checking for held inode locks in lfs_fast...
details: https://anonhg.NetBSD.org/src/rev/b00a5f713896
branches: trunk
changeset: 471802:b00a5f713896
user: perseant <perseant%NetBSD.org@localhost>
date: Mon Apr 12 00:11:01 1999 +0000
description:
Better checking for held inode locks in lfs_fastvget, for a number of error
conditions. Also change the default setting of lfs_clean_vnhead to 0, which
seems to make the locking problems go away (although this is difficult to
test as I can't reliably reproduce them).
diffstat:
sys/ufs/lfs/lfs_segment.c | 13 ++++++++++---
sys/ufs/lfs/lfs_syscalls.c | 8 ++++++--
2 files changed, 16 insertions(+), 5 deletions(-)
diffs (77 lines):
diff -r 6b67c2931db1 -r b00a5f713896 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Mon Apr 12 00:04:21 1999 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Mon Apr 12 00:11:01 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_segment.c,v 1.24 1999/04/12 00:04:21 perseant Exp $ */
+/* $NetBSD: lfs_segment.c,v 1.25 1999/04/12 00:11:01 perseant Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -135,7 +135,7 @@
int lfs_allclean_wakeup; /* Cleaner wakeup address. */
int lfs_writeindir = 1; /* whether to flush indir on non-ckp */
-int lfs_clean_vnhead = 1; /* Allow freeing to head of vn list */
+int lfs_clean_vnhead = 0; /* Allow freeing to head of vn list */
/* Statistics Counters */
int lfs_dostats = 1;
@@ -1542,7 +1542,10 @@
simple_unlock(&vp->v_interlock);
return;
}
-
+#ifdef DIAGNOSTIC
+ if(VOP_ISLOCKED(vp))
+ panic("lfs_vunref: vnode locked");
+#endif
/*
* insert at tail of LRU list
*/
@@ -1575,6 +1578,10 @@
simple_unlock(&vp->v_interlock);
return;
}
+#ifdef DIAGNOSTIC
+ if(VOP_ISLOCKED(vp))
+ panic("lfs_vunref_head: vnode locked");
+#endif
/*
* insert at head of LRU list
*/
diff -r 6b67c2931db1 -r b00a5f713896 sys/ufs/lfs/lfs_syscalls.c
--- a/sys/ufs/lfs/lfs_syscalls.c Mon Apr 12 00:04:21 1999 +0000
+++ b/sys/ufs/lfs/lfs_syscalls.c Mon Apr 12 00:11:01 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_syscalls.c,v 1.27 1999/04/11 23:24:04 perseant Exp $ */
+/* $NetBSD: lfs_syscalls.c,v 1.28 1999/04/12 00:11:01 perseant Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -960,6 +960,7 @@
ufs_ihashrem(ip);
/* Unlock and discard unneeded inode. */
+ lockmgr(&ip->i_lock, LK_RELEASE, &vp->v_interlock);
lfs_vunref(vp);
*vpp = NULL;
return (error);
@@ -979,6 +980,7 @@
ufs_ihashrem(ip);
/* Unlock and discard unneeded inode. */
+ lockmgr(&ip->i_lock, LK_RELEASE, &vp->v_interlock);
lfs_vunref(vp);
brelse(bp);
*vpp = NULL;
@@ -995,7 +997,9 @@
*/
error = ufs_vinit(mp, lfs_specop_p, lfs_fifoop_p, &vp);
if (error) {
- printf("ufs_vinit returned %d for ino %d\n", error, ino);
+ /* This CANNOT happen (see ufs_vinit) */
+ printf("lfs_fastvget: ufs_vinit returned %d for ino %d\n", error, ino);
+ lockmgr(&ip->i_lock, LK_RELEASE, &vp->v_interlock);
lfs_vunref(vp);
*vpp = NULL;
return (error);
Home |
Main Index |
Thread Index |
Old Index