[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yqf+J/P1/24i6rN9@slm.duckdns.org>
Date: Mon, 13 Jun 2022 17:19:03 -1000
From: Tejun Heo <tj@...nel.org>
To: Imran Khan <imran.f.khan@...cle.com>
Cc: gregkh@...uxfoundation.org, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/4] kernfs: make ->attr.open RCU protected.
On Tue, Jun 14, 2022 at 12:08:37PM +1000, Imran Khan wrote:
> +static struct kernfs_open_node *
> +kernfs_deref_open_node(struct kernfs_open_file *of, struct kernfs_node *kn)
> +{
> + struct kernfs_open_node *on;
> + bool deref_ok;
> +
> + deref_ok = (of ? !list_empty(&of->list) : false) ||
> + lockdep_is_held(&kernfs_open_file_mutex);
> +
> + on = rcu_dereference_check(kn->attr.open, deref_ok);
> +
> + return on;
> +}
Hahahaha didn't know they'd be taking two different arguments. Sorry about
the many iterations but it'd probably be better to have two different
versions for the two argument types. Other than that, looks fine to me.
Thanks.
--
tejun
Powered by blists - more mailing lists