[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjmgord99A-Gwy3dsiG1YNeXTCbt+z6=3RH_je5PP41Zw@mail.gmail.com>
Date: Wed, 27 Sep 2023 11:05:37 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: Christian Brauner <brauner@...nel.org>, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2] vfs: shave work on failed file open
On Wed, 27 Sept 2023 at 10:56, Mateusz Guzik <mjguzik@...il.com> wrote:
>
> Comments in the patch explicitly mention dodgin RCU for the file object.
Not the commit message,. and the comment is also actually pretty
obscure and only talks about the freeing part.
The cred part is what actually made me go "why is that even rcu-free'd".
I *think* it's bogus, but I didn't go look at the history of it .
> Well put_cred is called synchronously, but should this happen to be
> the last ref on them, they will get call_rcu(&cred->rcu,
> put_cred_rcu)'ed.
Yes. But the way it's done in __fput() you end up potentially
RCU-delaying it twice. Odd.
The reason we rcu-delay the 'struct file *' is because of the
__fget_files_rcu() games.
But I don't see why the cred thing is there.
Historical mistake? But it all looks a bit odd, and because of that it
worries me.
Linus
Powered by blists - more mailing lists