diff options
author | mckusick <mckusick@FreeBSD.org> | 2001-06-13 23:13:13 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2001-06-13 23:13:13 +0000 |
commit | 2f9709c0f1e1952c3be380e8b407a98632986680 (patch) | |
tree | b687767f10fd061ae962945d47eca32e6dc37e88 /sys/ufs/ffs | |
parent | 52cb477a723866786a1cd3049d901c2862b0843d (diff) | |
download | FreeBSD-src-2f9709c0f1e1952c3be380e8b407a98632986680.zip FreeBSD-src-2f9709c0f1e1952c3be380e8b407a98632986680.tar.gz |
Build on the change in revision 1.98 by Tor.Egge@fast.no.
The symptom being treated in 1.98 was to avoid freeing a
pagedep dependency if there was still a newdirblk dependency
referencing it. That change is correct and no longer prints
a warning message when it occurs. The other part of revision
1.98 was to panic when a newdirblk dependency was encountered
during a file truncation. This fix removes that panic and
replaces it with code to find and delete the newdirblk
dependency so that the truncation can succeed.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 321e01c..86f9111 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1933,9 +1933,19 @@ deallocate_dependencies(bp, inodedep) &dirrem->dm_list); } if ((pagedep->pd_state & NEWBLOCK) != 0) { - FREE_LOCK(&lk); - panic("deallocate_dependencies: " - "active pagedep"); + LIST_FOREACH(wk, &inodedep->id_bufwait, wk_list) + if (wk->wk_type == D_NEWDIRBLK && + WK_NEWDIRBLK(wk)->db_pagedep == + pagedep) + break; + if (wk != NULL) { + WORKLIST_REMOVE(wk); + free_newdirblk(WK_NEWDIRBLK(wk)); + } else { + FREE_LOCK(&lk); + panic("deallocate_dependencies: " + "lost pagedep"); + } } WORKLIST_REMOVE(&pagedep->pd_list); LIST_REMOVE(pagedep, pd_hash); @@ -3930,17 +3940,15 @@ handle_written_filepage(pagedep, bp) return (1); } /* - * If no dependencies remain, the pagedep will be freed. - * Otherwise it will remain to update the page before it - * is written back to disk. + * If no dependencies remain and we are not waiting for a + * new directory block to be claimed by its inode, then the + * pagedep will be freed. Otherwise it will remain to track + * any new entries on the page in case they are fsync'ed. */ - 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); - } + if (LIST_FIRST(&pagedep->pd_pendinghd) == 0 && + (pagedep->pd_state & NEWBLOCK) == 0) { + LIST_REMOVE(pagedep, pd_hash); + WORKITEM_FREE(pagedep, D_PAGEDEP); } return (0); } |