Commit 21ff365b authored by Vincent Donnefort's avatar Vincent Donnefort Committed by Steven Rostedt (Google)

selftests/ring-buffer: Verify the entire meta-page padding

Improve the ring-buffer meta-page test coverage by checking for the
entire padding region to be 0 instead of just looking at the first 4
bytes.

Cc: linux-kselftest@vger.kernel.org
Link: https://lore.kernel.org/20240910162335.2993310-2-vdonnefort@google.comAcked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarVincent Donnefort <vdonnefort@google.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 2fcd5aff
......@@ -231,15 +231,15 @@ TEST_F(map, data_mmap)
/* Verify meta-page padding */
if (desc->meta->meta_page_size > getpagesize()) {
void *addr;
data_len = desc->meta->meta_page_size;
data = mmap(NULL, data_len,
PROT_READ, MAP_SHARED, desc->cpu_fd, 0);
ASSERT_NE(data, MAP_FAILED);
addr = (void *)((unsigned long)data + getpagesize());
ASSERT_EQ(*((int *)addr), 0);
for (int i = desc->meta->meta_struct_len;
i < desc->meta->meta_page_size; i += sizeof(int))
ASSERT_EQ(*(int *)(data + i), 0);
munmap(data, data_len);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment