[PATCH] Btrfs: cleanup the left refs on the cluster list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
---
 fs/btrfs/extent-tree.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

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;
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux