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


---

 25-akpm/fs/reiserfs/inode.c |    2 +-
 25-akpm/fs/reiserfs/stree.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/reiserfs/inode.c~reiserfs-should-end-jbegin fs/reiserfs/inode.c
--- 25/fs/reiserfs/inode.c~reiserfs-should-end-jbegin	2004-03-12 18:25:28.334349904 -0800
+++ 25-akpm/fs/reiserfs/inode.c	2004-03-12 18:25:28.340348992 -0800
@@ -209,7 +209,7 @@ static int file_capable (struct inode * 
   pathrelse(path) ;
   reiserfs_update_sd(th, inode) ;
   journal_end(th, s, len) ;
-  journal_begin(th, s, len) ;
+  journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6) ;
   reiserfs_update_inode_transaction(inode) ;
 }
 
diff -puN fs/reiserfs/stree.c~reiserfs-should-end-jbegin fs/reiserfs/stree.c
--- 25/fs/reiserfs/stree.c~reiserfs-should-end-jbegin	2004-03-12 18:25:28.335349752 -0800
+++ 25-akpm/fs/reiserfs/stree.c	2004-03-12 18:25:28.338349296 -0800
@@ -1757,7 +1757,7 @@ void reiserfs_do_truncate (struct reiser
 	  reiserfs_update_sd(th, p_s_inode) ;
 
 	  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) ;
 	}
     } while ( n_file_size > ROUND_UP (n_new_file_size) &&

_