]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tools: fix atomic_set() definition to set the value correctly
authorSuren Baghdasaryan <surenb@google.com>
Fri, 27 Dec 2024 22:22:20 +0000 (14:22 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 13 Jan 2025 03:03:35 +0000 (19:03 -0800)
Currently vma test is failing because of the new vma_assert_attached()
assertion.  The check is failing because previous refcount_set() inside
vma_mark_attached() is a NoOp.  Fix the definition of atomic_set() to
correctly set the value of the atomic.

Link: https://lkml.kernel.org/r/20241227222220.1726384-1-surenb@google.com
Fixes: 9325b8b5a1cb ("tools: add skeleton code for userland testing of VMA logic")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Jann Horn <jannh@google.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/shared/linux/maple_tree.h
tools/testing/vma/linux/atomic.h

index 06c89bdcc515410e6262ee65a084c02cd8b241bc..f67d47d32857cee296c2784da57825c9a31cd340 100644 (file)
@@ -2,6 +2,6 @@
 #define atomic_t int32_t
 #define atomic_inc(x) uatomic_inc(x)
 #define atomic_read(x) uatomic_read(x)
-#define atomic_set(x, y) do {} while (0)
+#define atomic_set(x, y) uatomic_set(x, y)
 #define U8_MAX UCHAR_MAX
 #include "../../../../include/linux/maple_tree.h"
index e01f66f989827985b038812e86ed13a15bb21115..3e1b6adc027b996b310cc74d07a1a9071e642fab 100644 (file)
@@ -6,7 +6,7 @@
 #define atomic_t int32_t
 #define atomic_inc(x) uatomic_inc(x)
 #define atomic_read(x) uatomic_read(x)
-#define atomic_set(x, y) do {} while (0)
+#define atomic_set(x, y) uatomic_set(x, y)
 #define U8_MAX UCHAR_MAX
 
 #endif /* _LINUX_ATOMIC_H */