summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2024-10-15 14:07:45 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-11-07 05:11:14 +0100
commit4223dd93bfc976debededffc0b03cc63d9b73d14 (patch)
tree63cb94ed609521b152663f0e88b4bdf922dcf368 /lib
parentmaple_tree: clear request_count for new allocated one (diff)
downloadlinux-4223dd93bfc976debededffc0b03cc63d9b73d14.tar.xz
linux-4223dd93bfc976debededffc0b03cc63d9b73d14.zip
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/20241015120746.15850-3-richard.weiyang@gmail.com Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/maple_tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index ee7922b19f0a..1b80201865d8 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1297,10 +1297,9 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
nomem_bulk:
/* Clean up potential freed allocations on bulk failure */
memset(slots, 0, max_req * sizeof(unsigned long));
+ mas->alloc->total = allocated;
nomem_one:
mas_set_alloc_req(mas, requested);
- if (mas->alloc && !(((unsigned long)mas->alloc & 0x1)))
- mas->alloc->total = allocated;
mas_set_err(mas, -ENOMEM);
}