Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs Assert lfs_writer where I think we can now prove...



details:   https://anonhg.NetBSD.org/src/rev/440309c2dcca
branches:  trunk
changeset: 849186:440309c2dcca
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Feb 23 08:39:39 2020 +0000

description:
Assert lfs_writer where I think we can now prove it.

diffstat:

 sys/ufs/lfs/lfs_vnops.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r 42a1442578b0 -r 440309c2dcca sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Sun Feb 23 08:39:28 2020 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Sun Feb 23 08:39:39 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.326 2020/02/23 08:38:58 riastradh Exp $        */
+/*     $NetBSD: lfs_vnops.c,v 1.327 2020/02/23 08:39:39 riastradh Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.326 2020/02/23 08:38:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.327 2020/02/23 08:39:39 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1616,12 +1616,14 @@
        int error = 0;
 
        ASSERT_MAYBE_SEGLOCK(fs);
-       KASSERT(fs->lfs_nadirop == 0);
+       KASSERT(fs->lfs_nadirop == 0); /* stable during lfs_writer */
+       KASSERT(fs->lfs_dirops == 0);  /* stable during lfs_writer */
 
        if (fs->lfs_ronly)
                return EROFS;
 
        mutex_enter(&lfs_lock);
+       KASSERT(fs->lfs_writer);
        if (TAILQ_FIRST(&fs->lfs_dchainhd) == NULL) {
                mutex_exit(&lfs_lock);
                return 0;
@@ -1655,6 +1657,7 @@
         *
         */
        mutex_enter(&lfs_lock);
+       KASSERT(fs->lfs_writer);
        TAILQ_INSERT_HEAD(&fs->lfs_dchainhd, marker, i_lfs_dchain);
        while ((ip = TAILQ_NEXT(marker, i_lfs_dchain)) != NULL) {
                TAILQ_REMOVE(&fs->lfs_dchainhd, marker, i_lfs_dchain);
@@ -1755,6 +1758,7 @@
        int error, error2;
 
        ASSERT_NO_SEGLOCK(fs);
+       KASSERT(fs->lfs_writer);
 
        if (fs->lfs_ronly)
                return EROFS;



Home | Main Index | Thread Index | Old Index