All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: jbacik@fb.com, linux-fsdevel@vger.kernel.org
Subject: Re: find_fh_dentry returned a DISCONNECTED directory
Date: Fri, 14 Feb 2014 17:19:30 -0500	[thread overview]
Message-ID: <20140214221929.GC3506@fieldses.org> (raw)
In-Reply-To: <8738jltyop.fsf@xmission.com>

On Fri, Feb 14, 2014 at 09:02:30AM -0800, Eric W. Biederman wrote:
> "J. Bruce Fields" <bfields@fieldses.org> writes:
> 
> > On Fri, Feb 14, 2014 at 07:49:35AM -0800, Eric W. Biederman wrote:
> >> 
> >> I believe we want both groups of dentries on the s_anon list so that if
> >> they remain disconnected when the filesystem is unmounted we can
> >> find them and deal with them.
> >
> > Note it's IS_ROOT(), not DCACHE_DISCONNECTED, that determines whether a
> > hashed dentry is on s_anon or not.  (See
> > 7632e465feb182cadc3c9aa1282a057201818a8c for more detailed
> > discussion.)
> 
> Interesting.  It remains the case that d_obtain_alias that sets
> DCACHE_DISCONNECTED is the only way to get on the s_anon list.

You're right, I forgot that.

> >From the rest of the conversation below I think what is needed is
> d_obtain_alias_root.   A function like d_obtain_alias but that does not
> set DCACHE_DISCONNECTED, that places IS_ROOT dentries on the s_anon list
> and that is usually expected to not find an alias.

Sounds good.

> I suspect the code would be much clearer if we were to do a mass
> s/DCACHE_DISCONNECTED/DCACHE_CONNECTING/ to make it clear that the
> flag is not intended to cover the general case of when dentries are
> floating around without parents.

I'm all for it.

bfields@pepper:linux-2.6$ git grep DCACHE_DISCONNECTED|wc -l
24

So it's not so terrible.  All but a few are in dcache.c and expfs.c.

> I am in the final stages of putting together some patches so that
> filesystems don't need to like to the vfs to preserve vfs invariants
> about mountpoints.  In particular I am implemeting automatic detaching
> of mountpionts on unlink and d_invalidate.  Once that is done and
> everyone is dropping directory dentries instead of sticking to the
> silly 2.2 era logic that present resides in d_invalidate some of these
> other dcache uses should become a little less mysterious.

OK.

--b.

  reply	other threads:[~2014-02-14 22:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 21:27 find_fh_dentry returned a DISCONNECTED directory J. Bruce Fields
2014-02-13 23:45 ` Eric W. Biederman
2014-02-14  3:30   ` J. Bruce Fields
2014-02-14  4:25     ` Eric W. Biederman
2014-02-14 14:46       ` J. Bruce Fields
2014-02-14 15:49         ` Eric W. Biederman
2014-02-14 16:14           ` J. Bruce Fields
2014-02-14 16:38             ` Josef Bacik
2014-02-14 16:45               ` J. Bruce Fields
2014-02-14 17:02                 ` Josef Bacik
2014-02-14 17:14                   ` Eric W. Biederman
2014-02-14 17:11               ` Eric W. Biederman
2014-02-14 17:02             ` Eric W. Biederman
2014-02-14 22:19               ` J. Bruce Fields [this message]
2014-02-14 22:41                 ` J. Bruce Fields
2014-02-14 14:17     ` Josef Bacik
2014-02-14 15:13     ` Josef Bacik
2014-02-14 15:38       ` J. Bruce Fields

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=20140214221929.GC3506@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=ebiederm@xmission.com \
    --cc=jbacik@fb.com \
    --cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.