[patch 22/27] ext3 truncate fix

Andrew Morton (akpm@zip.com.au)
Thu, 04 Jul 2002 16:55:08 -0700


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.

inode.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

--- 2.5.24/fs/ext3/inode.c~ext3-truncate-fix Thu Jul 4 16:17:31 2002
+++ 2.5.24-akpm/fs/ext3/inode.c Thu Jul 4 16:17:31 2002
@@ -1632,8 +1632,10 @@ ext3_clear_blocks(handle_t *handle, stru
}
ext3_mark_inode_dirty(handle, inode);
ext3_journal_test_restart(handle, inode);
- BUFFER_TRACE(bh, "get_write_access");
- ext3_journal_get_write_access(handle, bh);
+ if (bh) {
+ BUFFER_TRACE(bh, "retaking write access");
+ ext3_journal_get_write_access(handle, bh);
+ }
}

/*

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/