[lkml]   [2020]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 5/9] XArray: entry in last level is not expected to be a node
On Mon, Mar 30, 2020 at 05:48:42AM -0700, Matthew Wilcox wrote:
>On Mon, Mar 30, 2020 at 12:36:39PM +0000, Wei Yang wrote:
>> If an entry is at the last level, whose parent's shift is 0, it is not
>> expected to be a node. We can just leverage the xa_is_node() check to
>> break the loop instead of check shift additionally.
>I know you didn't run the test suite after making this change.

Well, I got your point finally. From commit 76b4e5299565 ('XArray: Permit
storing 2-byte-aligned pointers'), xa_is_node() will not be *ACURATE*. Those
2-byte align pointers will be treated as node too.

Well, I found another thing, but not sure whether you have fixed this or not.

If applying following change

@@ -1461,6 +1461,11 @@ static void check_align_1(struct xarray *xa, char *name)
GFP_KERNEL) != 0);
XA_BUG_ON(xa, id != i);
+ XA_STATE_ORDER(xas, xa, 0, 0);
+ entry = xas_find_conflict(&xas);
xa_for_each(xa, index, entry)
XA_BUG_ON(xa, xa_is_err(entry));

We trigger an error message. The reason is the same. And we can fix this with
the same approach in xas_find_conflict().

If you think this is the proper way, I would add a patch for this.

Wei Yang
Help you, Help me

 \ /
  Last update: 2020-04-06 03:25    [W:0.126 / U:5.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site