From: David Howells <dhowells@redhat.com>
To: Linux filesystem caching discussion list <linux-cachefs@redhat.com>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [Linux-cachefs] 3.0.3 64-bit Crash running fscache/cachefilesd
Date: Mon, 26 Sep 2011 12:32:00 +0100 [thread overview]
Message-ID: <5149.1317036720@redhat.com> (raw)
In-Reply-To: <CAOH1cHm-hbC=KZJsT1H5ohVEJVzNvqaKatKVS+s2nKVkAMgX9w@mail.gmail.com>
Mark Moseley <moseleymark@gmail.com> wrote:
> I thought I'd be extra-helpful by getting that trace with a 3.0.4
> kernel but got a completely different error this time (there was
> nothing logged above this though). There was a
> '__fscache_read_or_alloc_pages' crash for the previous boot too,
> though it went for about 2.5 hours that time (with an empty cache
> partition though).
I'm fairly certain I know what the cause of this one is: Invalidation upon
server change isn't handled correctly. NFS tries to invalidate a file by
discarding that file's attachment to the cache - without first clearing up the
operations it has outstanding on the cache for that file.
I'm working on adding formal invalidation at the moment.
The attached patch may get you more precise information. The first hunk is the
main catcher.
David
---
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 9905350..48c63b8 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -452,6 +452,13 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
_debug("RELEASE OBJ%x", object->debug_id);
+ if (atomic_read(&object->n_reads)) {
+ spin_unlock(&cookie->lock);
+ printk(KERN_ERR "FS-Cache: Cookie '%s' still has outstanding reads\n",
+ cookie->def->name);
+ BUG();
+ }
+
/* detach each cache object from the object cookie */
spin_lock(&object->lock);
hlist_del_init(&object->cookie_link);
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index b8b62f4..f087051 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -496,6 +496,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
if (fscache_submit_op(object, &op->op) < 0)
goto nobufs_unlock;
spin_unlock(&cookie->lock);
+ ASSERTCMP(object->cookie, ==, cookie);
fscache_stat(&fscache_n_retrieval_ops);
@@ -513,6 +514,26 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
goto error;
/* ask the cache to honour the operation */
+ if (!object->cookie) {
+ const char prefix[] = "fs-";
+ printk(KERN_ERR "%sobject: OBJ%x\n",
+ prefix, object->debug_id);
+ printk(KERN_ERR "%sobjstate=%s fl=%lx wbusy=%x ev=%lx[%lx]\n",
+ prefix, fscache_object_states[object->state],
+ object->flags, work_busy(&object->work),
+ object->events,
+ object->event_mask & FSCACHE_OBJECT_EVENTS_MASK);
+ printk(KERN_ERR "%sops=%u inp=%u exc=%u\n",
+ prefix, object->n_ops, object->n_in_progress,
+ object->n_exclusive);
+ printk(KERN_ERR "%sparent=%p\n",
+ prefix, object->parent);
+ printk(KERN_ERR "%scookie=%p [pr=%p nd=%p fl=%lx]\n",
+ prefix, object->cookie,
+ cookie->parent, cookie->netfs_data, cookie->flags);
+ }
+ ASSERTCMP(object->cookie, ==, cookie);
+
if (test_bit(FSCACHE_COOKIE_NO_DATA_YET, &object->cookie->flags)) {
fscache_stat(&fscache_n_cop_allocate_pages);
ret = object->cache->ops->allocate_pages(
next prev parent reply other threads:[~2011-09-26 11:32 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 16:44 3.0.3 64-bit Crash running fscache/cachefilesd Mark Moseley
2011-08-26 12:52 ` [Linux-cachefs] " Дмитрий Ильин
2011-09-01 13:04 ` David Howells
2011-09-22 17:03 ` Mark Moseley
2011-09-22 21:41 ` Mark Moseley
2011-09-26 11:32 ` David Howells [this message]
2011-09-26 21:02 ` Mark Moseley
2011-09-27 0:59 ` Mark Moseley
2011-09-27 23:46 ` Mark Moseley
2011-09-29 14:57 ` David Howells
2011-09-29 15:51 ` Mark Moseley
2011-09-29 16:30 ` David Howells
2011-09-29 19:02 ` Mark Moseley
2011-09-29 22:11 ` Mark Moseley
2011-09-29 22:44 ` Mark Moseley
2011-09-29 22:44 ` David Howells
2011-09-29 22:51 ` Mark Moseley
2011-09-30 12:28 ` David Howells
2011-09-30 18:57 ` Mark Moseley
2011-09-30 20:10 ` David Howells
2011-10-05 13:37 ` David Howells
2011-10-05 13:49 ` David Howells
2011-10-07 10:42 ` David Howells
2011-10-08 16:32 ` Mark Moseley
2011-10-11 13:07 ` David Howells
2011-10-11 16:27 ` Mark Moseley
2011-10-12 9:26 ` David Howells
2011-10-12 10:05 ` David Howells
2011-10-12 18:10 ` Mark Moseley
2011-10-12 23:38 ` Mark Moseley
2011-10-13 15:21 ` David Howells
2011-10-13 20:48 ` Mark Moseley
2011-10-14 9:22 ` David Howells
2011-10-14 23:25 ` Mark Moseley
2011-10-17 10:39 ` David Howells
2011-10-19 12:25 ` David Howells
2011-10-19 23:15 ` Mark Moseley
2011-10-20 8:46 ` David Howells
2011-10-20 19:37 ` Mark Moseley
2011-10-20 9:03 ` David Howells
2011-10-20 19:29 ` Mark Moseley
2011-10-20 23:05 ` David Howells
2011-10-21 0:21 ` Mark Moseley
2011-10-21 8:16 ` David Howells
2011-10-21 18:09 ` Mark Moseley
2011-12-13 1:56 ` Mark Moseley
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=5149.1317036720@redhat.com \
--to=dhowells@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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).