From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Chris Dunlop <chris@onthe.net.au>
Cc: David Howells <dhowells@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>,
"Myklebust, Trond" <Trond.Myklebust@netapp.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Eric Van Hensbergen <ericvh@gmail.com>,
Ron Minnich <rminnich@sandia.gov>,
Latchesar Ionkov <lucho@ionkov.net>,
Jan Harkes <jaharkes@cs.cmu.edu>,
"\"maintainer@onthe.net.au\":CODA FILE SYSTEM" <coda@cs.cmu.edu>,
Petr Vandrovec <petr@vandrovec.name>,
Greg Kroah-Hartman <gregkh@suse.de>,
v9fs-developer@lists.sourceforge.net,
linux-afs@lists.infradead.org, codalist@TELEMANN.coda.cs.cmu.edu,
jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] fix d_revalidate oopsen on NFS exports
Date: Wed, 30 Nov 2011 21:53:16 -0600 [thread overview]
Message-ID: <4ED6FA2C.7010005@oracle.com> (raw)
In-Reply-To: <20111201033346.GA1049@onthe.net.au>
On 11/30/2011 09:33 PM, Chris Dunlop wrote:
> On Wed, Nov 30, 2011 at 08:22:39PM -0600, Dave Kleikamp wrote:
>> On 11/30/2011 06:47 PM, Chris Dunlop wrote:
>>>> It's also worth printing a message - this *is* a kernel bug of some description
>>>> if it happens.
>>>
>>> Like the below? This covers the d_revalidate for 9p, afs, coda,
>>> hfs, ncpfs, proc, sysfs.
>>>
>>> Note: jfs isn't susceptible to this problem, but the resolution
>>> doesn't look like the other file systems, and from the comment
>>> I'm not sure if the problem was really understood and if it's
>>> doing the right thing:
>>
>> This code, as well as the comments, were copied from vfat. It seems
>> reasonable for case-insensitive but case-preserving behavior (not jfs's
>> default). The safe thing is to drop the negative dentry if we don't know
>> the operation.
>
> In that case, it looks like the thing to do might be to add the
> "protection" to the start of jfs_ci_revaliate(), per how the
> original has been changed in vfat:
The LOOKUP_RCU check had previously been there, but Al Viro removed it:
commit 5c0f360b083fb33d05d1bff4b138b82d715eb419
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sat Jun 25 21:41:09 2011 -0400
jfs_ci_revalidate() is safe from RCU mode
I'm not sure what it takes to be "safe", but this is a simple function
that doesn't block, take locks, or do much of anything. You shouldn't
need to do anything with jfs.
Shaggy
>
> fs/fat/namei_vfat.c:
> static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd)
> {
> if (nd && nd->flags & LOOKUP_RCU)
> return -ECHILD;
> ...
> }
>
> E.g.:
>
> ----------------------------------------------------------------------
> Don't oops when abused by broken layered file systems
>
> Signed-off-by: Chris Dunlop <chris@onthe.net.au>
> ---
> fs/jfs/namei.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
> index e17545e..5504f6e 100644
> --- a/fs/jfs/namei.c
> +++ b/fs/jfs/namei.c
> @@ -1585,6 +1585,9 @@ out:
>
> static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)
> {
> + if (nd && nd->flags & LOOKUP_RCU)
> + return -ECHILD;
> +
> /*
> * This is not negative dentry. Always valid.
> *
WARNING: multiple messages have this Message-ID (diff)
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Chris Dunlop <chris@onthe.net.au>
Cc: Latchesar Ionkov <lucho@ionkov.net>,
Jan Harkes <jaharkes@cs.cmu.edu>,
jfs-discussion@lists.sourceforge.net,
Eric Van Hensbergen <ericvh@gmail.com>,
codalist@TELEMANN.coda.cs.cmu.edu,
Greg Kroah-Hartman <gregkh@suse.de>,
"Myklebust, Trond" <Trond.Myklebust@netapp.com>,
linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
"\"maintainer@onthe.net.au\":CODA FILE SYSTEM" <coda@cs.cmu.edu>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-nfs@vger.kernel.org, v9fs-developer@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, Ron Minnich <rminnich@sandia.gov>,
Petr Vandrovec <petr@vandrovec.name>,
linux-afs@lists.infradead.org
Subject: Re: [PATCH 1/1] fix d_revalidate oopsen on NFS exports
Date: Wed, 30 Nov 2011 21:53:16 -0600 [thread overview]
Message-ID: <4ED6FA2C.7010005@oracle.com> (raw)
In-Reply-To: <20111201033346.GA1049@onthe.net.au>
On 11/30/2011 09:33 PM, Chris Dunlop wrote:
> On Wed, Nov 30, 2011 at 08:22:39PM -0600, Dave Kleikamp wrote:
>> On 11/30/2011 06:47 PM, Chris Dunlop wrote:
>>>> It's also worth printing a message - this *is* a kernel bug of some description
>>>> if it happens.
>>>
>>> Like the below? This covers the d_revalidate for 9p, afs, coda,
>>> hfs, ncpfs, proc, sysfs.
>>>
>>> Note: jfs isn't susceptible to this problem, but the resolution
>>> doesn't look like the other file systems, and from the comment
>>> I'm not sure if the problem was really understood and if it's
>>> doing the right thing:
>>
>> This code, as well as the comments, were copied from vfat. It seems
>> reasonable for case-insensitive but case-preserving behavior (not jfs's
>> default). The safe thing is to drop the negative dentry if we don't know
>> the operation.
>
> In that case, it looks like the thing to do might be to add the
> "protection" to the start of jfs_ci_revaliate(), per how the
> original has been changed in vfat:
The LOOKUP_RCU check had previously been there, but Al Viro removed it:
commit 5c0f360b083fb33d05d1bff4b138b82d715eb419
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sat Jun 25 21:41:09 2011 -0400
jfs_ci_revalidate() is safe from RCU mode
I'm not sure what it takes to be "safe", but this is a simple function
that doesn't block, take locks, or do much of anything. You shouldn't
need to do anything with jfs.
Shaggy
>
> fs/fat/namei_vfat.c:
> static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd)
> {
> if (nd && nd->flags & LOOKUP_RCU)
> return -ECHILD;
> ...
> }
>
> E.g.:
>
> ----------------------------------------------------------------------
> Don't oops when abused by broken layered file systems
>
> Signed-off-by: Chris Dunlop <chris@onthe.net.au>
> ---
> fs/jfs/namei.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
> index e17545e..5504f6e 100644
> --- a/fs/jfs/namei.c
> +++ b/fs/jfs/namei.c
> @@ -1585,6 +1585,9 @@ out:
>
> static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)
> {
> + if (nd && nd->flags & LOOKUP_RCU)
> + return -ECHILD;
> +
> /*
> * This is not negative dentry. Always valid.
> *
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
next prev parent reply other threads:[~2011-12-01 3:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-21 7:36 [PATCH 1/1] fix d_revalidate oopsen on NFS exports Chris Dunlop
2011-11-21 7:36 ` Chris Dunlop
2011-11-29 8:25 ` Chris Dunlop
2011-11-29 8:25 ` Chris Dunlop
2011-11-29 11:58 ` Myklebust, Trond
2011-11-29 11:58 ` Myklebust, Trond
2011-11-30 7:13 ` Chris Dunlop
2011-11-30 8:54 ` David Howells
2011-11-30 8:54 ` David Howells
2011-12-01 0:47 ` Chris Dunlop
2011-12-01 2:22 ` Dave Kleikamp
2011-12-01 3:33 ` Chris Dunlop
2011-12-01 3:53 ` Dave Kleikamp [this message]
2011-12-01 3:53 ` Dave Kleikamp
2011-12-01 5:32 ` Chris Dunlop
2011-12-01 5:32 ` Chris Dunlop
2011-12-01 5:34 ` Chris Dunlop
2011-12-01 5:34 ` Chris Dunlop
2011-12-01 6:31 ` Tyler Hicks
2011-12-01 7:29 ` Chris Dunlop
2011-12-01 7:29 ` Chris Dunlop
2011-12-06 11:43 ` Jacek Luczak
2011-12-01 6:50 ` Tyler Hicks
2011-12-01 7:23 ` Chris Dunlop
2011-12-01 7:23 ` Chris Dunlop
2011-12-01 8:02 ` Tyler Hicks
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=4ED6FA2C.7010005@oracle.com \
--to=dave.kleikamp@oracle.com \
--cc=Trond.Myklebust@netapp.com \
--cc=chris@onthe.net.au \
--cc=coda@cs.cmu.edu \
--cc=codalist@TELEMANN.coda.cs.cmu.edu \
--cc=dhowells@redhat.com \
--cc=ericvh@gmail.com \
--cc=gregkh@suse.de \
--cc=jaharkes@cs.cmu.edu \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=linux-afs@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=petr@vandrovec.name \
--cc=rminnich@sandia.gov \
--cc=v9fs-developer@lists.sourceforge.net \
--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 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.