Commit 134ab3f5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reiserfs: fix transaction sizes

From: Chris Mason <mason@suse.com>

Make sure reiserfs uses a reasonable number when restarting long unbounded
transactions (creating holes or deleting files).

Without this patch, the number of blocks requested grows with each
transaction restart, until it hits MAX_BATCH_COUNT and starts forcing
commits with every new transaction.

Oleg Drokin tracked this bug down
parent df773a2c
...@@ -209,7 +209,7 @@ static int file_capable (struct inode * inode, long block) ...@@ -209,7 +209,7 @@ static int file_capable (struct inode * inode, long block)
pathrelse(path) ; pathrelse(path) ;
reiserfs_update_sd(th, inode) ; reiserfs_update_sd(th, inode) ;
journal_end(th, s, len) ; journal_end(th, s, len) ;
journal_begin(th, s, len) ; journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6) ;
reiserfs_update_inode_transaction(inode) ; reiserfs_update_inode_transaction(inode) ;
} }
......
...@@ -1757,7 +1757,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, ...@@ -1757,7 +1757,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
reiserfs_update_sd(th, p_s_inode) ; reiserfs_update_sd(th, p_s_inode) ;
journal_end(th, p_s_inode->i_sb, orig_len_alloc) ; journal_end(th, p_s_inode->i_sb, orig_len_alloc) ;
journal_begin(th, p_s_inode->i_sb, orig_len_alloc) ; journal_begin(th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 6) ;
reiserfs_update_inode_transaction(p_s_inode) ; reiserfs_update_inode_transaction(p_s_inode) ;
} }
} while ( n_file_size > ROUND_UP (n_new_file_size) && } while ( n_file_size > ROUND_UP (n_new_file_size) &&
......
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