diff mbox

Btrfs: cleanup the left refs on the cluster list

Message ID 1360392122-5934-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu Bo Feb. 9, 2013, 6:42 a.m. UTC
When we're going to abort the transaction, we need to first do cleanup
work for the left refs on the cluster list, otherwise we'll get list_del
debug warnings.

(Taken from Miao's patch: Btrfs: fix deadlock when the process of delayed refs fails)

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/extent-tree.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 61da9d0..7e7884f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2500,6 +2500,12 @@  again:
 
 		ret = run_clustered_refs(trans, root, &cluster);
 		if (ret < 0) {
+			if (!list_empty(&cluster)) {
+				struct list_head *pos, *next;
+
+				list_for_each_safe(pos, next, &cluster);
+					list_del_init(pos);
+			}
 			spin_unlock(&delayed_refs->lock);
 			btrfs_abort_transaction(trans, root, ret);
 			return ret;