linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [vfsmounts] WARNING: CPU: 1 PID: 479 at fs/dcache.c:385 d_lru_del()
Date: Sun, 10 Nov 2013 17:29:07 +0800	[thread overview]
Message-ID: <20131110092907.GA21120@localhost> (raw)
In-Reply-To: <20131109051931.GT13318@ZenIV.linux.org.uk>

On Sat, Nov 09, 2013 at 05:19:31AM +0000, Al Viro wrote:
> On Sat, Nov 09, 2013 at 11:06:36AM +0800, Fengguang Wu wrote:
> > Greetings,
> > 
> > I got the below dmesg and the first bad commit is
> > 
> > commit 84550b9356af50c7cbd6b6ce6e8fd06585eebf14
> > Author: Al Viro <viro@zeniv.linux.org.uk>
> > Date:   Sun Sep 29 22:06:07 2013 -0400
> 
> 	Got it...  See if the following fixes the problem - it's
> shrink_dcache_for_umount() needing to be careful after possible
> run of d_genocide(); we are left with dentries that have zero
> refcount and are not on any LRU.  And yes, it's d_genocide() being
> not nice, exactly because it relies upon shrink_dcache_for_umount()
> coming right after it to sweep the garbage.  So we'd better be
> ready to deal with said garbage...
> 
> 	Diff below fixes that junk here.  Folded and re-pushed...

Thanks! I can confirm that it fixed the bug.

Tested-by: Fengguang Wu <fengguang.wu@intel.com>

> diff --git a/fs/dcache.c b/fs/dcache.c
> index 50d4357..72c99b8 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -1391,7 +1391,8 @@ static enum d_walk_ret umount_collect(void *_data, struct dentry *dentry)
>  		 * need to get the global LRU lock and do the
>  		 * LRU accounting.
>  		 */
> -		d_lru_del(dentry);
> +		if (dentry->d_flags & DCACHE_LRU_LIST)
> +			d_lru_del(dentry);
>  		d_shrink_add(dentry, &data->dispose);
>  		data->found++;
>  		ret = D_WALK_NORETRY;

      reply	other threads:[~2013-11-10  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-09  3:06 [vfsmounts] WARNING: CPU: 1 PID: 479 at fs/dcache.c:385 d_lru_del() Fengguang Wu
2013-11-09  5:19 ` Al Viro
2013-11-10  9:29   ` Fengguang Wu [this message]

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=20131110092907.GA21120@localhost \
    --to=fengguang.wu@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).