diff options
author | obrien <obrien@FreeBSD.org> | 2001-06-05 01:49:37 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-06-05 01:49:37 +0000 |
commit | c3d076fe2842af38cc11ffacbb9c6849388e771b (patch) | |
tree | eab52606b377299c6a2ea731432b3a7664f10f47 /sys/ufs | |
parent | db8173f50ef21c9b3ec7c0096b4565345b015a9a (diff) | |
download | FreeBSD-src-c3d076fe2842af38cc11ffacbb9c6849388e771b.zip FreeBSD-src-c3d076fe2842af38cc11ffacbb9c6849388e771b.tar.gz |
There seems to be a problem that the order of disk write operation being
incorrect due to a missing check for some dependency. This change
avoids the freelist corruption (but not the temporarily inconsistent
state of the file system).
A message is printed as a reminder of the under lying problem when a
pagedep structure is not freed due to the NEWBLOCK flag being set.
Submitted by: Tor.Egge@fast.no
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 56cf0cb..321e01c 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1932,6 +1932,11 @@ deallocate_dependencies(bp, inodedep) WORKLIST_INSERT(&inodedep->id_bufwait, &dirrem->dm_list); } + if ((pagedep->pd_state & NEWBLOCK) != 0) { + FREE_LOCK(&lk); + panic("deallocate_dependencies: " + "active pagedep"); + } WORKLIST_REMOVE(&pagedep->pd_list); LIST_REMOVE(pagedep, pd_hash); WORKITEM_FREE(pagedep, D_PAGEDEP); @@ -3930,8 +3935,12 @@ handle_written_filepage(pagedep, bp) * is written back to disk. */ if (LIST_FIRST(&pagedep->pd_pendinghd) == 0) { - LIST_REMOVE(pagedep, pd_hash); - WORKITEM_FREE(pagedep, D_PAGEDEP); + if ((pagedep->pd_state & NEWBLOCK) != 0) { + printf("handle_written_filepage: active pagedep\n"); + } else { + LIST_REMOVE(pagedep, pd_hash); + WORKITEM_FREE(pagedep, D_PAGEDEP); + } } return (0); } |