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
This commit is contained in:
David E. O'Brien 2001-06-05 01:49:37 +00:00
parent d33f4d20c9
commit 1239674238
1 changed files with 11 additions and 2 deletions

View File

@ -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,9 +3935,13 @@ handle_written_filepage(pagedep, bp)
* is written back to disk.
*/
if (LIST_FIRST(&pagedep->pd_pendinghd) == 0) {
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);
}