diff options
| author | Kirk McKusick <mckusick@FreeBSD.org> | 2001-05-19 19:24:26 +0000 |
|---|---|---|
| committer | Kirk McKusick <mckusick@FreeBSD.org> | 2001-05-19 19:24:26 +0000 |
| commit | dc01275be969f600d6cafce55725315658c517d0 (patch) | |
| tree | 4b0e3675ca55a34a8861ddd87f1e891bcc6fe254 | |
| parent | 2f1cb61572946861d7044a26f2390322a8be6bb0 (diff) | |
Notes
| -rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index efa0966c42b4..56cf0cb561a0 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2017,12 +2017,20 @@ free_newdirblk(newdirblk) panic("free_newdirblk: lock not held"); #endif /* - * Free any directory additions that have been committed. + * If the pagedep is still linked onto the directory buffer + * dependency chain, then some of the entries on the + * pd_pendinghd list may not be committed to disk yet. In + * this case, we will simply clear the NEWBLOCK flag and + * let the pd_pendinghd list be processed when the pagedep + * is next written. If the pagedep is no longer on the buffer + * dependency chain, then all the entries on the pd_pending + * list are committed to disk and we can free them here. */ pagedep = newdirblk->db_pagedep; pagedep->pd_state &= ~NEWBLOCK; - while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) - free_diradd(dap); + if ((pagedep->pd_state & ONWORKLIST) == 0) + while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) + free_diradd(dap); /* * If no dependencies remain, the pagedep will be freed. */ |
