From patchwork Fri Dec 6 06:04:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 3293141 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 29CD89F387 for ; Fri, 6 Dec 2013 06:04:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3741D20378 for ; Fri, 6 Dec 2013 06:04:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CDD120213 for ; Fri, 6 Dec 2013 06:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750814Ab3LFGEc (ORCPT ); Fri, 6 Dec 2013 01:04:32 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:17566 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752Ab3LFGEb (ORCPT ); Fri, 6 Dec 2013 01:04:31 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rB664T0q014892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Dec 2013 06:04:30 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rB664Sr4015117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Dec 2013 06:04:29 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rB664SAB029191; Fri, 6 Dec 2013 06:04:28 GMT Received: from localhost.localdomain (/10.191.2.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Dec 2013 22:04:27 -0800 Date: Fri, 6 Dec 2013 14:04:19 +0800 From: Liu Bo To: =?utf-8?B?U3rFkXRzIMOBa29z?= Cc: linux-btrfs@vger.kernel.org Subject: Re: btrfs-ino-cache runs on every boot for 6 minutes Message-ID: <20131206060419.GA20595@localhost.localdomain> Reply-To: bo.li.liu@oracle.com References: <1531404.tFNCiHaLVH@linux-suse.hu> <20131204021507.GH18095@localhost.localdomain> <2467502.UPcdayreHd@linux-suse.hu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2467502.UPcdayreHd@linux-suse.hu> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] 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.1 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 On Wed, Dec 04, 2013 at 01:41:42PM +0100, Sz?ts Ákos wrote: > Thank you for your answer. > > Here are the "blocked states" logs. Since I had a plenty of time, I made > multiple of them. The last two are the longest of them. > > - http://paste.opensuse.org/view/raw/51654551 > - http://paste.opensuse.org/view/raw/39005796 > - http://paste.opensuse.org/view/raw/38028651 > - http://paste.opensuse.org/view/raw/21592065 > - http://paste.opensuse.org/view/raw/46655344 > - http://paste.opensuse.org/view/raw/26821272 > > Ákos Could you please try the following and show me the output of dmesg? thanks, -liubo --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 057be95..8f7711e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -2950,11 +2950,16 @@ int load_free_ino_cache(struct btrfs_fs_info *fs_info, struct btrfs_root *root) return 0; inode = lookup_free_ino_inode(root, path); - if (IS_ERR(inode)) + if (IS_ERR(inode)) { + printk("%s: ino cache ino is NOT found\n", __func__); goto out; + } - if (root_gen != BTRFS_I(inode)->generation) + if (root_gen != BTRFS_I(inode)->generation) { + printk("%s: gen mismatch: root_gen_mem=%llu, root_gen=%llu, ino's gen=%llu\n", + __func__, btrfs_root_generation(&root->root_item), root_gen, BTRFS_I(inode)->generation); goto out_put; + } ret = __load_free_space_cache(root, inode, ctl, path, 0); diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c index ab485e5..6535139 100644 --- a/fs/btrfs/inode-map.c +++ b/fs/btrfs/inode-map.c @@ -473,7 +473,12 @@ again: } spin_lock(&root->cache_lock); - if (root->cached != BTRFS_CACHE_FINISHED) { + + /* ino cache has 3 state: + * BTRFS_CACHE_NO, BTRFS_CACHE_START, BTRFS_CACHE_FINISHED + */ + if (root->cached != BTRFS_CACHE_NO && root->cached != BTRFS_CACHE_FINISHED) { + printk("%s: bail out because it's not FINISHED, cached=%d\n", __func__, root->cached); ret = -1; spin_unlock(&root->cache_lock); goto out_put;