lkml.org 
[lkml]   [2021]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/4] cxl/mem: Fix synchronization mechanism for device removal vs ioctl operations
On Tue, Mar 30, 2021 at 09:05:29AM -0700, Dan Williams wrote:

> > If you can't clearly point to the *data* under RCU protection it is
> > being used wrong.
>
> Agree.
>
> The data being protected is the value of
> dev->kobj.state_in_sysfs. The

So where is that read under:

+ idx = srcu_read_lock(&cxl_memdev_srcu);
+ rc = __cxl_memdev_ioctl(cxlmd, cmd, arg);
+ srcu_read_unlock(&cxl_memdev_srcu, idx);

?

It can't read the RCU protected data outside the RCU critical region,
and it can't read/write RCU protected data without using the helper
macros which insert the required barriers.

IMHO this can't use 'dev->kobj.state_in_sysfs' as the RCU protected data.

Jason

\
 
 \ /
  Last update: 2021-03-30 19:05    [W:0.054 / U:23.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site