aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-02-18 23:56:23 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-02-18 23:56:23 +0000
commit98b6844690dbc9bba22e8c7c0f810e8567e78b84 (patch)
tree057142eaa7f317ce0e3a8d59c9dfb31e76eb788b /sys/ufs
parent868b51f2340e78285761b2fec32e3048202ab516 (diff)
downloadsrc-98b6844690dbc9bba22e8c7c0f810e8567e78b84.tar.gz
src-98b6844690dbc9bba22e8c7c0f810e8567e78b84.zip
Additional KASSERTs to ensure the consistency of the soft updates
indirdep structure. No functional change. Tested by: Peter Holm (as part of a larger patch) Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=358085
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 4e6ed2fe8d64..086d3a3df012 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -8224,8 +8224,13 @@ indir_trunc(freework, dbn, lbn)
* If we're goingaway, free the indirdep. Otherwise it will
* linger until the write completes.
*/
- if (goingaway)
+ if (goingaway) {
+ KASSERT(indirdep->ir_savebp == bp,
+ ("indir_trunc: losing ir_savebp %p",
+ indirdep->ir_savebp));
+ indirdep->ir_savebp = NULL;
free_indirdep(indirdep);
+ }
}
FREE_LOCK(ump);
/* Initialize pointers depending on block size. */
@@ -10739,6 +10744,8 @@ free_indirdep(indirdep)
("free_indirdep: %p still on newblk list.", indirdep));
KASSERT(indirdep->ir_saveddata == NULL,
("free_indirdep: %p still has saved data.", indirdep));
+ KASSERT(indirdep->ir_savebp == NULL,
+ ("free_indirdep: %p still has savebp buffer.", indirdep));
if (indirdep->ir_state & ONWORKLIST)
WORKLIST_REMOVE(&indirdep->ir_list);
WORKITEM_FREE(indirdep, D_INDIRDEP);