lkml.org 
[lkml]   [2019]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectxarray reserve/release?
Hey Matt,

Did you intend that xa_release doesn't work on allocating arrays:

xa_init_flags(&xa, XA_FLAGS_ALLOC);
xa_reserve(&xa, 0, GFP_KERNEL);
WARN_ON(xa_empty(&xa));
xa_release(&xa, 0);
WARN_ON(!xa_empty(&xa));

Triggers the second WARN_ON.

If FLAGS_ALLOC is removed this passes

This creates kind of a confusing / super unexpected situation where

xa_for_each (xa, id)
xa_erase(xa, id);
WARN_ON(!xa_empty(&xa))

Is not safe with XA_FLAGS_ALLOC??

Seems like at least deserves a documentation note.. Or maybe ALLOC
xa_empty should do something different?

Thanks,
Jason

\
 
 \ /
  Last update: 2019-02-20 00:55    [W:0.049 / U:4.484 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site