Skip to content

Commit 4223dd9

Browse files
RichardWeiYangakpm00
authored andcommitted
maple_tree: total is not changed for nomem_one case
If it jumps to nomem_one, the total allocated number is not changed. So we don't need to adjust it. For the nomem_bulk case, we know there is a valid mas->alloc. So we don't need to do the check. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Cc: Sidhartha Kumar <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent e852cb1 commit 4223dd9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/maple_tree.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,9 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
12971297
nomem_bulk:
12981298
/* Clean up potential freed allocations on bulk failure */
12991299
memset(slots, 0, max_req * sizeof(unsigned long));
1300+
mas->alloc->total = allocated;
13001301
nomem_one:
13011302
mas_set_alloc_req(mas, requested);
1302-
if (mas->alloc && !(((unsigned long)mas->alloc & 0x1)))
1303-
mas->alloc->total = allocated;
13041303
mas_set_err(mas, -ENOMEM);
13051304
}
13061305

0 commit comments

Comments
 (0)