diff options
author | Chuck Silvers <chs@FreeBSD.org> | 2020-02-03 17:47:14 +0000 |
---|---|---|
committer | Chuck Silvers <chs@FreeBSD.org> | 2020-02-03 17:47:14 +0000 |
commit | 62612737d687436b8e90851ef998ed65314ad63e (patch) | |
tree | c225f4dccb403f33b7db94255119d86a303ed2ce /sys/ufs | |
parent | 58aa35d42975c298ca0adba705c042596303c9f5 (diff) | |
download | src-test-62612737d687436b8e90851ef998ed65314ad63e.tar.gz src-test-62612737d687436b8e90851ef998ed65314ad63e.zip |
Notes
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 16 | ||||
-rw-r--r-- | sys/ufs/ffs/softdep.h | 5 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index b4704a11eec6a..8b88bf12c2a59 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1208,6 +1208,9 @@ workitem_free(item, type) ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); atomic_subtract_long(&dep_current[item->wk_type], 1); ump->softdep_curdeps[item->wk_type] -= 1; +#ifdef INVARIANTS + LIST_REMOVE(item, wk_all); +#endif free(item, DtoM(type)); } @@ -1234,6 +1237,9 @@ workitem_alloc(item, type, mp) ump->softdep_curdeps[type] += 1; ump->softdep_deps++; ump->softdep_accdeps++; +#ifdef INVARIANTS + LIST_INSERT_HEAD(&ump->softdep_alldeps[type], item, wk_all); +#endif FREE_LOCK(ump); } @@ -2532,6 +2538,10 @@ softdep_mount(devvp, mp, fs, cred) ump->indir_hash_size = i - 1; for (i = 0; i <= ump->indir_hash_size; i++) TAILQ_INIT(&ump->indir_hashtbl[i]); +#ifdef INVARIANTS + for (i = 0; i <= D_LAST; i++) + LIST_INIT(&ump->softdep_alldeps[i]); +#endif ACQUIRE_GBLLOCK(&lk); TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); FREE_GBLLOCK(&lk); @@ -2638,10 +2648,14 @@ softdep_unmount(mp) ump->bmsafemap_hash_size); free(ump->indir_hashtbl, M_FREEWORK); #ifdef INVARIANTS - for (i = 0; i <= D_LAST; i++) + for (i = 0; i <= D_LAST; i++) { KASSERT(ump->softdep_curdeps[i] == 0, ("Unmount %s: Dep type %s != 0 (%ld)", ump->um_fs->fs_fsmnt, TYPENAME(i), ump->softdep_curdeps[i])); + KASSERT(LIST_EMPTY(&ump->softdep_alldeps[i]), + ("Unmount %s: Dep type %s not empty (%p)", ump->um_fs->fs_fsmnt, + TYPENAME(i), LIST_FIRST(&ump->softdep_alldeps[i]))); + } #endif free(ump->um_softdep, M_MOUNTDATA); } diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h index 52e1de6ea1170..6fd248eb63874 100644 --- a/sys/ufs/ffs/softdep.h +++ b/sys/ufs/ffs/softdep.h @@ -216,6 +216,7 @@ struct worklist { #ifdef INVARIANTS const char *wk_func; /* func where added / removed */ int wk_line; /* line where added / removed */ + LIST_ENTRY(worklist) wk_all; /* list of deps of this type */ #endif }; #define WK_DATA(wk) ((void *)(wk)) @@ -1073,6 +1074,9 @@ struct mount_softdeps { TAILQ_ENTRY(mount_softdeps) sd_next; /* List of softdep filesystem */ struct ufsmount *sd_ump; /* our ufsmount structure */ u_long sd_curdeps[D_LAST + 1]; /* count of current deps */ +#ifdef INVARIANTS + struct workhead sd_alldeps[D_LAST + 1];/* Lists of all deps */ +#endif }; /* * Flags for communicating with the syncer thread. @@ -1113,3 +1117,4 @@ struct mount_softdeps { #define softdep_flags um_softdep->sd_flags #define softdep_flushtd um_softdep->sd_flushtd #define softdep_curdeps um_softdep->sd_curdeps +#define softdep_alldeps um_softdep->sd_alldeps |