summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-03-25 19:34:00 +0300
committerChristian Brauner <brauner@kernel.org>2026-03-26 16:36:03 +0300
commit94505767bd32f8a240cf3590776b16a12d75d98e (patch)
tree3d9cc28d26371e80f93a40882d75b5daeea75a84
parent4bbf3f58e00f8671eb384c7df6983d803058b204 (diff)
downloadlinux-94505767bd32f8a240cf3590776b16a12d75d98e.tar.xz
fat: fix stack frame size warnings in KUnit tests
The kernel test robot reported that on hexagon with clang, several test functions in fat_test.c exceed the 1280-byte stack frame limit. The root cause is the compound literal assignment in fat_test_set_time_offset(): *sbi = (struct msdos_sb_info){}; struct msdos_sb_info contains two hash tables of 256 hlist_head entries (FAT_HASH_SIZE), making it several kilobytes. The compound literal creates a temporary on the stack, and when clang inlines fat_test_set_time_offset() into each test function, the large temporary inflates every caller's stack frame beyond the limit. Replace the compound literal with memset() which zeroes the struct in-place without a stack temporary. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202603251755.4UYY1Rcd-lkp@intel.com/ Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/fat/fat_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/fat_test.c b/fs/fat/fat_test.c
index 5c97a7fcc41d..886bf044a9f1 100644
--- a/fs/fat/fat_test.c
+++ b/fs/fat/fat_test.c
@@ -218,7 +218,7 @@ KUNIT_ARRAY_PARAM(fat_truncate_atime, truncate_atime_test_cases,
static void fat_test_set_time_offset(struct msdos_sb_info *sbi, int time_offset)
{
- *sbi = (struct msdos_sb_info){};
+ memset(sbi, 0, sizeof(*sbi));
sbi->options.tz_set = 1;
sbi->options.time_offset = time_offset;
}