
From: Chris Mason <mason@suse.com>

Make sure to hold the BKL while ending a transaction in the error path or
reiserfs_prepare_write.


---

 25-akpm/fs/reiserfs/inode.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -puN fs/reiserfs/inode.c~reiserfs-end-trans-bkl fs/reiserfs/inode.c
--- 25/fs/reiserfs/inode.c~reiserfs-end-trans-bkl	2004-04-06 20:48:56.513893128 -0700
+++ 25-akpm/fs/reiserfs/inode.c	2004-04-06 20:49:22.496943104 -0700
@@ -2258,8 +2258,11 @@ int reiserfs_prepare_write(struct file *
 	if (th->t_refcount > old_ref) {
 	    if (old_ref)
 	    	th->t_refcount--;
-	    else
+	    else {
+		reiserfs_write_lock(inode->i_sb);
 		reiserfs_end_persistent_transaction(th);
+		reiserfs_write_unlock(inode->i_sb);
+	    }
 	}
     }
     return ret;

_
