public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: rwheeler@redhat.com, avati@redhat.com, bfoster@redhat.com,
	dhowells@redhat.com, eparis@redhat.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	mszeredi@suse.cz, KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>,
	Ian Kent <raven@themaw.net>
Subject: Re: [PATCH 0/9] [RFC v2] safely drop directory dentry on failed revalidate
Date: Wed, 21 Aug 2013 06:40:56 +0100	[thread overview]
Message-ID: <20130821054055.GN27005@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1375975490-18673-1-git-send-email-miklos@szeredi.hu>

On Thu, Aug 08, 2013 at 05:24:41PM +0200, Miklos Szeredi wrote:
> Here's a series for fixing issues with d_drop on a directory dentry with
> children and adding support for such dropped directories in fuse.
> 
> This one fixes a couple of issues I found with the previous incarnation and
> split out the filesystem parts into individual patches.

OK in general, but I'm not happy with the proliferation of such iterators in
fs/dcache.c ;-/  

We have have_submounts(), select_parent() and d_genocide(), with one more
such sucker added to the pile.  Sure, most of the callers of have_submounts()
are gone after that patchset, but we still have several left:
fs/autofs4/dev-ioctl.c:542:             err = have_submounts(path.dentry);
fs/autofs4/root.c:381:                  if (have_submounts(dentry)) {
fs/autofs4/waitq.c:338:         if (have_submounts(dentry))
fs/nilfs2/super.c:1010: if (have_submounts(root_dentry))

The thing is, the same race with mount() does, AFAICS, apply at least to
autofs4 call sites.

	And I would like to understand what nilfs one is trying to do...
Unless I'm seriously misreading that code, it's *not* on any kind of a hot
path, so I really wonder why don't we simply do shrink_dcache_parent() +
check if d_count has dropped to 1, without trying to look for submounts
first - if we have any, shrink_dcache_parent() is simply going to leave
us with d_count > 1 and that's it.  Actually, it's cheaper that way -
no need to walk the tree twice.  Moreover, checking for d_count == 1
case first is also pointless - in that case we have no children at all
and shrink_dcache_parent() will return immediately.  Could nilfs folks
explain why (and if) we need to bother with all that complexity there?

	We are really getting too many tree walkers in fs/dcache.c and
all that duplication is the prime breeding ground for bugs ;-/

  parent reply	other threads:[~2013-08-21  5:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 15:24 [PATCH 0/9] [RFC v2] safely drop directory dentry on failed revalidate Miklos Szeredi
2013-08-08 15:24 ` [PATCH 1/9] vfs: check submounts and drop atomically Miklos Szeredi
2013-08-12 13:27   ` Jeff Layton
2013-08-08 15:24 ` [PATCH 2/9] vfs: check unlinked ancestors before mount Miklos Szeredi
2013-08-12 13:33   ` Jeff Layton
2013-08-08 15:24 ` [PATCH 3/9] afs: use check_submounts_and_drop() Miklos Szeredi
2013-08-08 15:24 ` [PATCH 4/9] gfs2: " Miklos Szeredi
2013-08-08 15:24 ` [PATCH 5/9] nfs: " Miklos Szeredi
2013-08-12 13:34   ` Jeff Layton
2013-08-08 15:24 ` [PATCH 6/9] sysfs: " Miklos Szeredi
2013-08-08 15:24 ` [PATCH 7/9] fuse: use d_materialise_unique() Miklos Szeredi
2013-08-08 15:24 ` [PATCH 8/9] fuse: clean up return in fuse_dentry_revalidate() Miklos Szeredi
2013-08-08 15:24 ` [PATCH 9/9] fuse: drop dentry on failed revalidate Miklos Szeredi
2013-08-21  5:40 ` Al Viro [this message]
2013-08-21 20:04   ` [PATCH 0/9] [RFC v2] safely drop directory " Ryusuke Konishi
2013-08-21 21:00     ` Al Viro
2013-08-21 23:47       ` Ryusuke Konishi
2013-08-29  3:51   ` Miklos Szeredi
2013-08-29 23:24     ` Ian Kent
2013-08-29 23:44       ` Ian Kent
2013-08-30  8:59         ` Miklos Szeredi
2013-09-01  0:56           ` Ian Kent
2013-09-01  1:00             ` Ian Kent

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=20130821054055.GN27005@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=avati@redhat.com \
    --cc=bfoster@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=eparis@redhat.com \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@suse.cz \
    --cc=raven@themaw.net \
    --cc=rwheeler@redhat.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