Commit 66c1d66f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3 truncate fix

Forward-port of a fix which Stephen has applied to ext3's 2.4 CVS tree.

Fix for a rare problem seen under stress in data=journal mode: if we
have to restart a truncate transaction while traversing the inode's
direct blocks, we need to deal with bh==NULL in ext3_clear_blocks.
parent c0902cac
...@@ -1632,9 +1632,11 @@ ext3_clear_blocks(handle_t *handle, struct inode *inode, struct buffer_head *bh, ...@@ -1632,9 +1632,11 @@ ext3_clear_blocks(handle_t *handle, struct inode *inode, struct buffer_head *bh,
} }
ext3_mark_inode_dirty(handle, inode); ext3_mark_inode_dirty(handle, inode);
ext3_journal_test_restart(handle, inode); ext3_journal_test_restart(handle, inode);
BUFFER_TRACE(bh, "get_write_access"); if (bh) {
BUFFER_TRACE(bh, "retaking write access");
ext3_journal_get_write_access(handle, bh); ext3_journal_get_write_access(handle, bh);
} }
}
/* /*
* Any buffers which are on the journal will be in memory. We find * Any buffers which are on the journal will be in memory. We find
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment