summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2024-12-27 14:22:20 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:23:01 +0100
commit2e3194dc1197df2f0f5a2c1f0cc3060d0fcc8d49 (patch)
tree6b1955a630d9ea18d3ee56f5decdaca9aa3f7bfc /tools/testing
parent9c035105c5537d2ecad6b9415e9417a1ffbd0a62 (diff)
downloadlinux-2e3194dc1197df2f0f5a2c1f0cc3060d0fcc8d49.tar.gz
linux-2e3194dc1197df2f0f5a2c1f0cc3060d0fcc8d49.tar.bz2
linux-2e3194dc1197df2f0f5a2c1f0cc3060d0fcc8d49.zip
tools: fix atomic_set() definition to set the value correctly
commit 4bbb6df62c54e6a2c1fcce4908df768f0cfa1e91 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/shared/linux/maple_tree.h2
-rw-r--r--tools/testing/vma/linux/atomic.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/shared/linux/maple_tree.h b/tools/testing/shared/linux/maple_tree.h
index 06c89bdcc515..f67d47d32857 100644
--- a/tools/testing/shared/linux/maple_tree.h
+++ b/tools/testing/shared/linux/maple_tree.h
@@ -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"
diff --git a/tools/testing/vma/linux/atomic.h b/tools/testing/vma/linux/atomic.h
index e01f66f98982..3e1b6adc027b 100644
--- a/tools/testing/vma/linux/atomic.h
+++ b/tools/testing/vma/linux/atomic.h
@@ -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 */