From: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
V9FS Developers <v9fs-developer@lists.sourceforge.net>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [V9fs-developer] [GIT PULL] 9p file system bug fixes for 2.6.35-rc2
Date: Tue, 08 Jun 2010 07:29:52 -0700 [thread overview]
Message-ID: <4C0E53E0.3010300@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1006071654290.4506@i5.linux-foundation.org>
Linus Torvalds wrote:
>
> On Mon, 7 Jun 2010, Eric Van Hensbergen wrote:
>> jvrao (2):
>> Add a helper function to get fsgid for a file create.
>> 9p: Add a wstat after TCREATE to fix the gid.
>
> Quite frankly, this looks rather broken.
>
> It uses "dentry->d_parent" without locking (it so happens to likely be ok,
> since we are in "create()" and thus should be holding the parent
> semaphore). On its own, that might be excusable (if people were even
> _aware_ of the this locking rule!), but it does so just to get the inode
> pointer to that parent.
>
> And the only thing that makes it ok to access dentry->d_parent - the fact
> that we are in v9fs_create() - is also the thing that should have made
> people look at the arguments to the function and say "hmm".
Silly me. I sent out another patch using the dir inode passed through arguments.
But we still need to analyze the use of dentry->d_parent in other parts of code..
- JV
>
> We pass in the directory inode pointer as an argument to the create
> function! The code could have used that thing directly, instead of
> mucking around with dentry pointers that it had no business looking at.
>
> I see why it seems to have happened: v9fs does the exact same thing for
> the pre-existing "v9fs_fid_lookup()". So there is history to this
> behavior.
>
> Maybe people weren't aware of the fact that just dereferencing
> dentry->d_parent willy-nilly isn't actually allowed. That field changes.
> Sure, there are cases where it's ok, but this is a dangerous thing to do
> in general.
>
> In fact, the other thing that I find doing that whole "dentry->d_parent"
> thing seems to literally be broken. If you look at v9fs_fid_lookup(),
> you'll notice how it walks up the d_parent chain, and at that point you do
> NOT own the directory i_mutex, so at that point d_parent really _can_ be
> changing wildly due to concurrent renames or whatever.
>
> So 9pfs seems to have some preexisting bugs in this area. I'm not going to
> pull new bug-prone code. See the other discussions about being tight this
> release about really _only_ taking regressions after the merge window
> closed.
>
> Linus
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> V9fs-developer mailing list
> V9fs-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/v9fs-developer
prev parent reply other threads:[~2010-06-08 14:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 20:02 [GIT PULL] 9p file system bug fixes for 2.6.35-rc2 Eric Van Hensbergen
2010-06-08 0:08 ` Linus Torvalds
2010-06-08 0:41 ` Al Viro
2010-06-08 0:48 ` Linus Torvalds
2010-06-16 16:42 ` [V9fs-developer] " Aneesh Kumar K. V
2010-06-24 16:30 ` Aneesh Kumar K. V
2010-06-29 20:18 ` Eric Van Hensbergen
2010-06-29 20:38 ` Linus Torvalds
2010-06-30 11:52 ` Aneesh Kumar K. V
2010-06-30 16:48 ` Linus Torvalds
2010-06-30 18:58 ` Aneesh Kumar K. V
2010-06-30 18:16 ` Latchesar Ionkov
2010-06-30 18:31 ` Linus Torvalds
2010-06-30 18:33 ` Aneesh Kumar K. V
2010-06-30 12:55 ` Aneesh Kumar K. V
2010-06-08 14:29 ` Venkateswararao Jujjuri (JV) [this message]
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=4C0E53E0.3010300@linux.vnet.ibm.com \
--to=jvrao@linux.vnet.ibm.com \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=v9fs-developer@lists.sourceforge.net \
/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