From: Eric Biggers <ebiggers3@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: fs/namei.c: Misuse of sequence counts?
Date: Sat, 11 Oct 2014 23:01:42 -0500 [thread overview]
Message-ID: <20141012040142.GB24463@zzz> (raw)
In-Reply-To: <20141012001259.GM7996@ZenIV.linux.org.uk>
On Sun, Oct 12, 2014 at 01:12:59AM +0100, Al Viro wrote:
>
> Huh? What's to guarantee that dentry hasn't become negative since the
> moment we'd fetched the seqcount? _That_ is the problem we are dealing
> with here - link_path_walk() relies on nd->inode being non-NULL.
Hmm, I guess that makes sense. So the code is actually verifying that the inode
is still the inode that was referenced from the current or root directory when
nd->path was set. But couldn't the problem also be solved by setting nd->inode
directly in the fs->seq retry loops? (The file descriptor case could be
'nd->inode = file_inode(f.file);'.) Then there would be no need for the extra
read_seqcount_retry() just for the inode. The patch you posted looks correct,
but I wonder if this approach would be better.
next prev parent reply other threads:[~2014-10-12 4:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-11 22:58 fs/namei.c: Misuse of sequence counts? Eric Biggers
2014-10-11 23:46 ` Al Viro
2014-10-12 3:55 ` Eric Biggers
2014-10-12 4:29 ` Al Viro
2014-10-12 0:12 ` Al Viro
2014-10-12 4:01 ` Eric Biggers [this message]
2014-10-12 4:37 ` Al Viro
2014-10-12 4:51 ` Eric Biggers
2014-10-12 5:08 ` Eric Biggers
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=20141012040142.GB24463@zzz \
--to=ebiggers3@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 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.