linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Ian Kent <raven@themaw.net>,
	autofs@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-fsdevel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] VFS: allow ->d_manage() to declare -EISDIR in rcu_walk mode.
Date: Fri, 1 Aug 2014 18:48:15 +1000	[thread overview]
Message-ID: <20140801184815.22dd193f@notabene.brown> (raw)
In-Reply-To: <20140801083318.GA4907@mwanda>

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

On Fri, 1 Aug 2014 11:33:18 +0300 Dan Carpenter <dan.carpenter@oracle.com>
wrote:

> On Wed, Jul 30, 2014 at 04:08:33PM +1000, NeilBrown wrote:
> > @@ -1110,11 +1110,16 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
> >  		 * Don't forget we might have a non-mountpoint managed dentry
> >  		 * that wants to block transit.
> >  		 */
> > -		if (unlikely(managed_dentry_might_block(path->dentry)))
> > +		switch (managed_dentry_rcu(path->dentry)) {
> > +		case -ECHILD:
> > +		default:
> >  			return false;
> > +		case -EISDIR:
> > +			return true;
> > +		}
> >  
> 
> Smatch says that any lines after that switch statement are unreachable.
> 
> Is the "default" intended?

Ugh.  It was an after thought.

The defined error codes are -ECHILD and -EISDIR.
But current code actually treats any other negative number as -ECHILD.
So I stuck in the default .... which of course was wrong.
I need to add
   case 0:
       break;

I'll send that out on Monday.

Thanks heaps.

NeilBrown


> 
> >  		if (!d_mountpoint(path->dentry))
> > -			return true;
> > +			return !(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT);
> >  
> >  		mounted = __lookup_mnt(path->mnt, path->dentry);
> >  		if (!mounted)
> 
> regards,
> dan carpenter


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-08-01  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  6:08 [PATCH] VFS: allow ->d_manage() to declare -EISDIR in rcu_walk mode NeilBrown
2014-07-30 20:16 ` Christoph Hellwig
2014-07-30 23:49   ` NeilBrown
2014-08-01  8:33 ` Dan Carpenter
2014-08-01  8:48   ` NeilBrown [this message]
2014-08-04  7:06     ` [PATCH - V2] " NeilBrown
2014-08-04  8:57       ` Al Viro

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=20140801184815.22dd193f@notabene.brown \
    --to=neilb@suse.de \
    --cc=autofs@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=rdunlap@infradead.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).