2006-02-08 06:51:04

by Chris Wright

[permalink] [raw]
Subject: [PATCH 05/23] [XFS] fix regression in xfs_buf_rele

-stable review patch. If anyone has any objections, please let us know.
------------------

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 <[email protected]>
Signed-off-by: Chris Wright <[email protected]>
---

fs/xfs/linux-2.6/xfs_buf.c | 7 +++++++
1 files changed, 7 insertions(+)

Index: linux-2.6.15.3/fs/xfs/linux-2.6/xfs_buf.c
===================================================================
--- linux-2.6.15.3.orig/fs/xfs/linux-2.6/xfs_buf.c
+++ linux-2.6.15.3/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);

--