lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/9] XArray: don't expect to have more nr_values than count
Date
The nr_values is expected to be smaller than count, use a more strict
boundary to do this check.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
lib/xarray.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xarray.c b/lib/xarray.c
index 1a092c87fca5..e08a0388a156 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -744,7 +744,7 @@ static void update_node(struct xa_state *xas, struct xa_node *node,
node->count += count;
node->nr_values += values;
XA_NODE_BUG_ON(node, node->count > XA_CHUNK_SIZE);
- XA_NODE_BUG_ON(node, node->nr_values > XA_CHUNK_SIZE);
+ XA_NODE_BUG_ON(node, node->nr_values > node->count);
xas_update(xas, node);
if (count < 0)
xas_delete_node(xas);
--
2.23.0
\
 
 \ /
  Last update: 2020-03-30 14:38    [W:0.144 / U:2.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site