Re: [PATCH v2 11/19] lib/stackdepot: use read/write lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 9, 2023 at 11:45 AM Alexander Potapenko <glider@xxxxxxxxxx> wrote:
>
> >  static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle)
> >  {
> >         union handle_parts parts = { .handle = handle };
> > -       /*
> > -        * READ_ONCE pairs with potential concurrent write in
> > -        * depot_init_pool.
> > -        */
> > -       int pools_num_cached = READ_ONCE(pools_num);
> >         void *pool;
> >         size_t offset = parts.offset << DEPOT_STACK_ALIGN;
> >         struct stack_record *stack;
> >
> > -       if (parts.pool_index > pools_num_cached) {
> > +       lockdep_assert_held(&pool_rwlock);
>
> Shouldn't it be lockdep_assert_held_read()?

Indeed, this is more precise. Will fix in v3, thanks!





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux