From: Liu Bo <bo.li.liu@oracle.com>
To: "Szőts Ákos" <szotsaki@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs-ino-cache runs on every boot for 6 minutes
Date: Fri, 6 Dec 2013 14:04:19 +0800 [thread overview]
Message-ID: <20131206060419.GA20595@localhost.localdomain> (raw)
In-Reply-To: <2467502.UPcdayreHd@linux-suse.hu>
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
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;
next prev parent reply other threads:[~2013-12-06 6:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 11:28 btrfs-ino-cache runs on every boot for 6 minutes Szőts Ákos
2013-12-03 13:22 ` Duncan
2013-12-04 2:15 ` Liu Bo
2013-12-04 12:41 ` Szőts Ákos
2013-12-06 6:04 ` Liu Bo [this message]
2013-12-06 12:46 ` Szőts Ákos
2013-12-06 13:30 ` Liu Bo
2013-12-07 14:48 ` Szőts Ákos
2013-12-05 9:14 ` Szőts Ákos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131206060419.GA20595@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=szotsaki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).