From patchwork Tue Jan 14 12:36:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3485671 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B558C02DC for ; Tue, 14 Jan 2014 12:38:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14E8C201E9 for ; Tue, 14 Jan 2014 12:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE5D3201E4 for ; Tue, 14 Jan 2014 12:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbaANMiH (ORCPT ); Tue, 14 Jan 2014 07:38:07 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:23232 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751329AbaANMiG (ORCPT ); Tue, 14 Jan 2014 07:38:06 -0500 X-IronPort-AV: E=Sophos;i="4.95,658,1384272000"; d="scan'208";a="9415220" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 14 Jan 2014 20:34:17 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0ECbrbi015995 for ; Tue, 14 Jan 2014 20:37:53 +0800 Received: from wangs.fnst.cn.fujitsu.com ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014011420364174-1067199 ; Tue, 14 Jan 2014 20:36:41 +0800 From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: don't miss roots in deletion during walking backrefs Date: Tue, 14 Jan 2014 20:36:48 +0800 Message-Id: <1389703008-1781-1-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/14 20:36:41, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/14 20:36:42, Serialize complete at 2014/01/14 20:36:42 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP btrfs_read_fs_root_no_name() will check its root refs, and will return us ENOENT if this root in deletion. However, in some case, for example qgroup, we still need to track those roots, fix it. Signed-off-by: Wang Shilong --- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 835b6c9..ec4a1d2 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -303,7 +303,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, root_key.objectid = ref->root_id; root_key.type = BTRFS_ROOT_ITEM_KEY; root_key.offset = (u64)-1; - root = btrfs_read_fs_root_no_name(fs_info, &root_key); + root = btrfs_get_fs_root(fs_info, &root_key, false); if (IS_ERR(root)) { ret = PTR_ERR(root); goto out;