Re: fs/ntfs/aops.c:378:12: warning: stack frame size (2216) exceeds limit (1024) in 'ntfs_read_folio'

From: Arnd Bergmann
Date: Mon Aug 15 2022 - 08:56:35 EST


On Mon, Aug 15, 2022 at 2:29 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Sun, Aug 14, 2022 at 08:21:36AM +0800, kernel test robot wrote:
> > Hi Matthew,
> >
> > FYI, the error/warning still remains.
>
> FYI, this is still not interesting.
> This is a hexagon 256kB PAGE_SIZE config, and so the amount of stack
> space is correspondingly larger. The frame size warning should be
> increased to allow for this.
>
> > >> fs/ntfs/aops.c:378:12: warning: stack frame size (2216) exceeds limit (1024) in 'ntfs_read_folio' [-Wframe-larger-than]

I don't think we should change the frame size warning for this, there is not
generally any correlation between page size and stack usage, so that would
just hide bugs elsewhere.

NTFS has had problems with stack usage on 64K+ pages before, the last
time we addressed this using 4eec7faf6775 ("fs: ntfs: Limit NTFS_RW to
page sizes smaller than 64k"), but it looks like this time it affects both
write and read support.

I checked hexagon ntfs with 64KB pages, and that stays below the 1024 byte
limit, so we could add another dependency

--- a/fs/ntfs/Kconfig
+++ b/fs/ntfs/Kconfig
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config NTFS_FS
tristate "NTFS file system support"
+ depends on PAGE_SIZE_LESS_THAN_256KB
select NLS
help
NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.

to rule out the broken case but still allow powerpc64 and arm64 with
64KB to use NTFS.

Arnd