lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND v4 1/4] kernfs: make ->attr.open RCU protected.
On Mon, Jun 13, 2022 at 01:56:43PM +1000, Imran Khan wrote:
> Agree. I did over think this and went for the safest interface that I could
> think of in each of the use cases. I will remove
> kernfs_check_open_node_protected and use kernfs_deref_open_node_protected in its
> place as well. This will cover all accesses under kernfs_open_file_mutex.
>
> But we will still need kernfs_deref_open_node for cases where
> !list_empty(&of->list) ensures safe access of ->attr.open and where we can't
> ensure holding of kernfs_open_file_mutex. So we will need 2 deref accessors.
> Right? Just asking this because you mentioned above to come up with one deref
> accessor that can be used in all three use cases
>
> Please let me if this sounds okay. I can send updated patch-set with these
> changes in place.

Just merge all three into one accessor. You can list both the !list_empty
condition and lock held conditions on the same rcu_dereference_check() call.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2022-06-13 21:17    [W:0.061 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site