linux/fs/fat
Arnd Bergmann e1a1729419 fat: avoid stack overflow warning
Building the fat kunit tests on with -fsanitize=alignment reveals some
rather excessive stack usage:

fs/fat/fat_test.c: In function 'fat_clus_to_blknr_test':
fs/fat/fat_test.c:33:1: error: the frame size of 4736 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]
   33 | }
      | ^
fs/fat/fat_test.c: In function 'fat_get_blknr_offset_test':
fs/fat/fat_test.c:52:1: error: the frame size of 4800 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]

The problem is clearly related to the on-stack copy of a local
msdos_sb_info structure.  Avoid this by making that copy 'static const'
and changing the called functions to accept a constant input.

Link: https://lore.kernel.org/20260515204456.2692208-1-arnd@kernel.org
Fixes: 410002f813 ("kunit: fat: test cluster and directory i_pos layout helpers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Adi Nata <adinata.softwareengineer@gmail.com>
Cc: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-07-09 15:48:55 -07:00
..
.kunitconfig fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
cache.c fat: remove unused parameter 2026-01-20 19:44:21 -08:00
dir.c fat: stop reading directory entries past the end-of-directory marker 2026-07-01 15:26:25 +02:00
fat_test.c fat: avoid stack overflow warning 2026-07-09 15:48:55 -07:00
fat.h fat: avoid stack overflow warning 2026-07-09 15:48:55 -07:00
fatent.c fat: Track metadata bhs in fs-private inode part 2026-03-26 15:03:32 +01:00
file.c fat: Implement fileattr_get for case sensitivity 2026-05-11 16:50:28 +02:00
inode.c fat: reject BPB volumes whose data area starts beyond total sectors 2026-06-17 15:37:46 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile fat: Add KUnit tests for checksums and timestamps 2021-08-13 13:13:18 -06:00
misc.c fat: add KUnit tests for timestamp conversion helpers 2026-03-24 23:37:16 +01:00
namei_msdos.c fat: Implement fileattr_get for case sensitivity 2026-05-11 16:50:28 +02:00
namei_vfat.c fat: Implement fileattr_get for case sensitivity 2026-05-11 16:50:28 +02:00
nfs.c fat: fix uninitialized field in nostale filehandles 2024-02-22 15:38:55 -08:00