From: Nathan Scott Date: Thu, 2 Feb 2006 02:30:43 +0000 (+1100) Subject: [PATCH] fix regression in xfs_buf_rele X-Git-Tag: v2.6.15.4~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7a9850f9a29508eb9ba7f43e733b01096bc171d;p=thirdparty%2Fkernel%2Fstable.git [PATCH] fix regression in xfs_buf_rele 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 Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 6fe21d2b88470..422848c23b0d8 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -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);