Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Deduplicate sanity check that seglock is held on...
details: https://anonhg.NetBSD.org/src/rev/82237e48a3b6
branches: trunk
changeset: 355346:82237e48a3b6
user: maya <maya%NetBSD.org@localhost>
date: Wed Jul 26 14:38:59 2017 +0000
description:
Deduplicate sanity check that seglock is held on segunlock
diffstat:
sys/ufs/lfs/lfs_subr.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (40 lines):
diff -r ce1823942ae3 -r 82237e48a3b6 sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c Wed Jul 26 09:53:09 2017 +0000
+++ b/sys/ufs/lfs/lfs_subr.c Wed Jul 26 14:38:59 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_subr.c,v 1.95 2017/06/19 12:09:37 maya Exp $ */
+/* $NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.95 2017/06/19 12:09:37 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.96 2017/07/26 14:38:59 maya Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -430,7 +430,10 @@
sp = fs->lfs_sp;
mutex_enter(&lfs_lock);
- KASSERT(LFS_SEGLOCK_HELD(fs));
+
+ if (!LFS_SEGLOCK_HELD(fs))
+ panic("lfs seglock not held");
+
if (fs->lfs_seglock == 1) {
if ((sp->seg_flags & (SEGM_PROT | SEGM_CLEAN)) == 0)
do_unmark_dirop = 1;
@@ -534,9 +537,6 @@
rw_exit(&fs->lfs_fraglock);
if (do_unmark_dirop)
lfs_unmark_dirop(fs);
- } else if (fs->lfs_seglock == 0) {
- mutex_exit(&lfs_lock);
- panic ("Seglock not held");
} else {
--fs->lfs_seglock;
mutex_exit(&lfs_lock);
Home |
Main Index |
Thread Index |
Old Index