
From: Chris Mason <mason@suse.com>

reiserfs_unmap_buffer should clean and wait on all buffers.  This fixes a
leak under fsx workloads.


---

 25-akpm/fs/reiserfs/tail_conversion.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

diff -puN fs/reiserfs/tail_conversion.c~reiserfs-truncate-leak fs/reiserfs/tail_conversion.c
--- 25/fs/reiserfs/tail_conversion.c~reiserfs-truncate-leak	Wed Mar 24 15:14:51 2004
+++ 25-akpm/fs/reiserfs/tail_conversion.c	Wed Mar 24 15:14:51 2004
@@ -139,11 +139,10 @@ int direct2indirect (struct reiserfs_tra
 
 /* stolen from fs/buffer.c */
 void reiserfs_unmap_buffer(struct buffer_head *bh) {
-  if (buffer_mapped(bh)) {
+    lock_buffer(bh) ;
     if (buffer_journaled(bh) || buffer_journal_dirty(bh)) {
       BUG() ;
     }
-    lock_buffer(bh) ;
     clear_buffer_dirty(bh) ;
     /* Remove the buffer from whatever list it belongs to. We are mostly
        interested in removing it from per-sb j_dirty_buffers list, to avoid
@@ -161,7 +160,6 @@ void reiserfs_unmap_buffer(struct buffer
     clear_buffer_new(bh);
     bh->b_bdev = NULL;
     unlock_buffer(bh) ;
-  }
 }
 
 static void

_
