From patchwork Sat Feb 9 06:42:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 2119831 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2DC393FCA4 for ; Sat, 9 Feb 2013 06:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792Ab3BIGpE (ORCPT ); Sat, 9 Feb 2013 01:45:04 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:16763 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726Ab3BIGpD (ORCPT ); Sat, 9 Feb 2013 01:45:03 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r196ixeO013502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 9 Feb 2013 06:44:59 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r196iwht015049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Feb 2013 06:44:58 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r196iwTZ003419; Sat, 9 Feb 2013 00:44:58 -0600 Received: from liubo.localdomain (/123.138.32.227) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Feb 2013 22:44:57 -0800 From: Liu Bo To: linux-btrfs@vger.kernel.org Cc: miaox@cn.fujitsu.com Subject: [PATCH] Btrfs: cleanup the left refs on the cluster list Date: Sat, 9 Feb 2013 14:42:02 +0800 Message-Id: <1360392122-5934-1-git-send-email-bo.li.liu@oracle.com> X-Mailer: git-send-email 1.7.7.6 X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 Signed-off-by: Liu Bo --- 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;