User: Password:
|
|
Subscribe / Log in / New account

Re: [PATCH] vfs: fix race in rcu lookup of pruned dentry

From:  Hugh Dickins <hughd-AT-google.com>
To:  Al Viro <viro-AT-zeniv.linux.org.uk>
Subject:  Re: [PATCH] vfs: fix race in rcu lookup of pruned dentry
Date:  Mon, 18 Jul 2011 19:07:54 -0700 (PDT)
Message-ID:  <alpine.LSU.2.00.1107181903350.23830@sister.anvils>
Cc:  Linus Torvalds <torvalds-AT-linux-foundation.org>, Andrew Morton <akpm-AT-linux-foundation.org>, Nick Piggin <npiggin-AT-kernel.dk>, linux-kernel-AT-vger.kernel.org, linux-fsdevel-AT-vger.kernel.org
Archive-link:  Article

On Tue, 19 Jul 2011, Al Viro wrote:
> On Mon, Jul 18, 2011 at 04:27:53PM -0700, Linus Torvalds wrote:
> > On Mon, Jul 18, 2011 at 4:21 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > >
> > > Linus, are you OK with me slapping your s-o-b on it?
> > 
> > Yup.
> > 
> > And it feels so right that I think we should just do it for 3.0.

It looked sane, but in fact was insane.  Enough testing for now,
I say it's good to go, if you fold in this small adjustment...

[PATCH] fix sense of __read_seqcount_retry test

Hah, good thing I hacked something in to check we're going the quick
way: __read_seqcount_retry() returns *true* when a retry is needed.

Signed-off-by: Hugh Dickins <hughd@google.com>
---
 fs/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 3.0-git+/fs/namei.c	2011-07-18 18:31:36.273731128 -0700
+++ linux/fs/namei.c	2011-07-18 18:32:35.158022444 -0700
@@ -960,7 +960,7 @@ static bool __follow_mount_rcu(struct na
 		 * so we can use __read_seqcount_retry() to check the prev
 		 * sequence numbers.
 		 */
-		if (!__read_seqcount_retry(&path->dentry->d_seq, nd->seq))
+		if (__read_seqcount_retry(&path->dentry->d_seq, nd->seq))
 			return false;
 		path->mnt = mounted;
 		path->dentry = mounted->mnt_root;
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



(Log in to post comments)


Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds