[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegts1pqM1Qi4sEAB22W1qBzZaAkgpY+LjBp65=Ns+KHB3w@mail.gmail.com>
Date: Mon, 24 Oct 2022 10:38:05 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Ian Kent <raven@...maw.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Tejun Heo <tj@...nel.org>, Minchan Kim <minchan@...nel.org>,
Eric Sandeen <sandeen@...deen.net>,
Al Viro <viro@...iv.linux.org.uk>,
Rick Lindsley <ricklind@...ux.vnet.ibm.com>,
David Howells <dhowells@...hat.com>,
Carlos Maiolino <cmaiolino@...hat.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] kernfs: dont take i_lock on revalidate
On Tue, 18 Oct 2022 at 04:32, Ian Kent <raven@...maw.net> wrote:
>
> In kernfs_dop_revalidate() when the passed in dentry is negative the
> dentry directory is checked to see if it has changed and if so the
> negative dentry is discarded so it can refreshed. During this check
> the dentry inode i_lock is taken to mitigate against a possible
> concurrent rename.
>
> But if it's racing with a rename, becuase the dentry is negative, it
> can't be the source it must be the target and it must be going to do
> a d_move() otherwise the rename will return an error.
>
> In this case the parent dentry of the target will not change, it will
> be the same over the d_move(), only the source dentry parent may change
> so the inode i_lock isn't needed.
>
> Signed-off-by: Ian Kent <raven@...maw.net>
Reviewed-by: Miklos Szeredi <mszeredi@...hat.com>
Powered by blists - more mailing lists