lkml.org 
[lkml]   [2023]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] ksmbd: replace rwlock with rcu for concurrenct access on conn list
Hi Sergey,

Thanks for reviewing,

On Mon, Jan 30, 2023 at 01:15:35PM +0900, Sergey Senozhatsky wrote:
> On (23/01/15 18:32), Dawei Li wrote:
> >
> > void ksmbd_conn_free(struct ksmbd_conn *conn)
> > {
> > - write_lock(&conn_list_lock);
> > - list_del(&conn->conns_list);
> > - write_unlock(&conn_list_lock);
> > + spin_lock(&conn_list_lock);
> > + list_del_rcu(&conn->conns_list);
> > + spin_unlock(&conn_list_lock);
synchronize_rcu();
> >
> > xa_destroy(&conn->sessions);
> > kvfree(conn->request_buf);
>
> From a quick look this does not seem like a correct RCU usage. E.g.
> where do you wait for grace periods and synchronize readers/writers?

Nice catch, I totally mess it up. Thanks!

At first glance, I assume synchronize_rcu() will do the job if sleeping
is OK?

Steve, Namjae,
Please drop this buggy patch from ksmbd-for-next.

Thanks,
Dawei

\
 
 \ /
  Last update: 2023-03-27 00:02    [W:0.057 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site