[PATCH] reiserfs: fix transaction overflowing

This patch fixes a bug in reiserfs truncate.  A transaction might overflow
when truncating long highly fragmented file.  The fix is to split
truncation into several transactions to avoid overflowing.

Signed-off-by: Vladimir V. Saveliev <[email protected]>
Cc; Charles McColgan <[email protected]>
Cc: Alexander Zarochentsev <[email protected]>
Cc: Hans Reiser <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Alexander Zarochentzev 2006-03-25 03:06:57 -08:00 • committed by Linus Torvalds
commit 23f9e0f891
2 changed files with 77 additions and 138 deletions

View file

@ -1704,6 +1704,11 @@ static inline int reiserfs_transaction_running(struct super_block *s)
return 0;
}
static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_handle *th)
{
return th->t_blocks_allocated - th->t_blocks_logged;
}
int reiserfs_async_progress_wait(struct super_block *s);
struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct