<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Chris Mason &lt;mason@suse.com&gt;

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-&gt;t_refcount &gt; old_ref) {
 	    if (old_ref)
 	    	th-&gt;t_refcount--;
-	    else
+	    else {
+		reiserfs_write_lock(inode-&gt;i_sb);
 		reiserfs_end_persistent_transaction(th);
+		reiserfs_write_unlock(inode-&gt;i_sb);
+	    }
 	}
     }
     return ret;

_
</pre></body></html>