summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2026-11-03 11:39:23 -0500
committerChristian Brauner <brauner@kernel.org>2026-11-05 22:56:31 +0100
commit8fa19db00bf36d334ef67b4a2157ecf3f28456cc (patch)
tree207d56e4ab9dd56909145c0f0ee3c946b1aae530 /tools/testing
parentde48f2a93e4f246a1dbb3c93dc777061e5861bd4 (diff)
selftests/mount_setattr: build with a 64-bit off_t
With glibc on 32-bit architectures, off_t is 32 bits unless _FILE_OFFSET_BITS=64 is defined, so the 2 GB ftruncate() of the ext4 image gets a negative length and the test fails: mount_setattr_test.c:1048:30: warning: implicit conversion from 'long long' to '__off_t' (aka 'long') changes value from 2147483648 to -2147483648 [-Wconstant-conversion] Build the test with -D_FILE_OFFSET_BITS=64. Signed-off-by: Sasha Levin <sashal@kernel.org> Link: https://patch.msgid.link/20261103163924.641377-1-sashal@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/mount_setattr/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/mount_setattr/Makefile b/tools/testing/selftests/mount_setattr/Makefile
index 4d4f810cdf2c..2e5b16fcdf10 100644
--- a/tools/testing/selftests/mount_setattr/Makefile
+++ b/tools/testing/selftests/mount_setattr/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for mount selftests.
-CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 -pthread
+CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 -pthread -D_FILE_OFFSET_BITS=64
LOCAL_HDRS += ../filesystems/wrappers.h