]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix regression in xfs_buf_rele
authorNathan Scott <nathans@sgi.com>
Thu, 2 Feb 2006 02:30:43 +0000 (13:30 +1100)
committerChris Wright <chrisw@sous-sol.org>
Fri, 10 Feb 2006 07:20:07 +0000 (23:20 -0800)
Fix regression in xfs_buf_rele dealing with non-hashed buffers, as
occur during log replay.  Novell bug 145204, Fedora bug 177848.

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/linux-2.6/xfs_buf.c

index 6fe21d2b884705d05b741cec4ee3e2cee1f03857..422848c23b0d87a8e2fc719b2e214c84e4ad997e 100644 (file)
@@ -830,6 +830,13 @@ pagebuf_rele(
 
        PB_TRACE(pb, "rele", pb->pb_relse);
 
+       if (unlikely(!hash)) {
+               ASSERT(!pb->pb_relse);
+               if (atomic_dec_and_test(&pb->pb_hold))
+                       xfs_buf_free(pb);
+               return;
+       }
+
        if (atomic_dec_and_lock(&pb->pb_hold, &hash->bh_lock)) {
                if (pb->pb_relse) {
                        atomic_inc(&pb->pb_hold);