lkml.org 
[lkml]   [2020]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] erofs: convert workstn to XArray
Hi Chao,

On Wed, Feb 19, 2020 at 03:46:16PM +0800, Chao Yu wrote:
> On 2020/2/17 11:30, Gao Xiang wrote:

[]

> > - return err;
> > + sbi = EROFS_SB(sb);
> > +repeat:
> > + xa_lock(&sbi->managed_pslots);
> > + pre = __xa_cmpxchg(&sbi->managed_pslots, grp->index,
> > + NULL, grp, GFP_NOFS);
> > + if (pre) {
>
> It looks __xa_cmpxchg() could return negative value in case of failure, e.g.
> no memory case. We'd better handle that case and old valid workgroup separately?

Thanks, that is a quite good catch!

To be honest, I'm not quite sure whether __xa_cmpxchg
could fail due to no memory here (as a quick scan, it
will do __xas_nomem loop interally.)

But anyway, it needs bailing out all potential errors
by using xa_is_err(). Will do some research and send
v3 then.

Thanks,
Gao Xiang

\
 
 \ /
  Last update: 2020-02-19 09:07    [W:0.037 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site