- Reinstate 1.142 this was fixed by 1.144.

This commit is contained in:
Jeff Roberson 2003-10-06 02:39:37 +00:00
parent 016b0ff405
commit 8af6a57099
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120839

View File

@ -2563,10 +2563,10 @@ indir_trunc(freeblks, dbn, level, lbn, countp)
* a complete copy of the indirect block in memory for our use.
* Otherwise we have to read the blocks in from the disk.
*/
bp = getblk(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, 0, 0,
GB_NOCREAT);
ACQUIRE_LOCK(&lk);
/* XXX Buf not locked! */
if ((bp = incore(freeblks->fb_devvp, dbn)) != NULL &&
(wk = LIST_FIRST(&bp->b_dep)) != NULL) {
if (bp != NULL && (wk = LIST_FIRST(&bp->b_dep)) != NULL) {
if (wk->wk_type != D_INDIRDEP ||
(indirdep = WK_INDIRDEP(wk))->ir_savebp != bp ||
(indirdep->ir_state & GOINGAWAY) == 0) {
@ -2582,6 +2582,8 @@ indir_trunc(freeblks, dbn, level, lbn, countp)
VFSTOUFS(freeblks->fb_mnt)->um_numindirdeps -= 1;
FREE_LOCK(&lk);
} else {
if (bp)
brelse(bp);
FREE_LOCK(&lk);
error = bread(freeblks->fb_devvp, dbn, (int)fs->fs_bsize,
NOCRED, &bp);