[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <q77njpa2bvo52lvlu47fa7tlkqivqwf2mwudxycsxqhu2mf35s@ye4i3gsy4bl7>
Date: Mon, 25 Nov 2024 15:49:34 +0100
From: Michal Koutný <mkoutny@...e.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
"Paul E. McKenney" <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Hillf Danton <hdanton@...a.com>,
Johannes Weiner <hannes@...xchg.org>, Marco Elver <elver@...gle.com>, Tejun Heo <tj@...nel.org>,
Zefan Li <lizefan.x@...edance.com>, tglx@...utronix.de,
syzbot+6ea37e2e6ffccf41a7e6@...kaller.appspotmail.com
Subject: Re: [PATCH v3] kernfs: Use RCU for kernfs_node::name and ::parent
lookup.
Hello.
On Thu, Nov 21, 2024 at 06:52:50PM GMT, Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
> - kernfs_rename_ns() is only using kernfs_rename_lock if the parents are
> different. All users users use either RCU or kernfs_rwsem.
> - kernfs_fop_readdir() drops kernfs_root::kernfs_rwsem while holding a
> reference to name and invoking dir_emit(). This has been changed and
> lock is held.
> - kernfs_notify_workfn() access kernfs_node::name without any
> protection. Added kernfs_root::kernfs_rwsem for the iteration.
> - kernfs_get_parent_dentry() acquires now kernfs_root::kernfs_rwsem
> while accessing the parent node.
> - kernfs_node_dentry() acquires now kernfs_root::kernfs_rwsem while
> parent is accessed and the name looked up.
Why is the kernfs_root::kernfs_rwsem newly R-taken? Shouldn't be RCU
read section sufficient for those users?
(Perhaps it's related to second observation I have -- why there is
sometimes kernfs_rcu_get_parent() whereas there are other call sites
with mere rcu_dereference(kn->parent)?)
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists