mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Christian Brauner" <brauner@kernel.org>,
	"Arnd Bergmann" <arnd@kernel.org>
Cc: "OGAWA Hirofumi" <hirofumi@mail.parknet.co.jp>,
	"Jan Kara" <jack@suse.cz>, avivdaum <aviv.daum@gmail.com>,
	"Adi Nata" <adinata.softwareengineer@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fat: avoid stack overflow warning
Date: Thu, 21 May 2026 14:03:51 +0200	[thread overview]
Message-ID: <0d75b50e-a233-498c-84ee-bd938ecaeaf9@app.fastmail.com> (raw)
In-Reply-To: <20260521-quark-klatschen-cf7a2a18ba34@brauner>

On Thu, May 21, 2026, at 13:41, Christian Brauner wrote:
> On Fri, May 15, 2026 at 10:44:46PM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> 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.
>> 
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>
> What is this based on, Arnd? I'm getting errors applying this.

I had assumed this was an old bug, as it showed up right after
I changed toolchains and ran into similar problems elsewhere.

Looking again, I see now that this just came in through
aecd952e23ee ("kunit: fat: test cluster and directory
i_pos layout helpers"), which is in the mm-nonmm-unstable
branch in current linux-next.

Maybe Andrew can just fold my fixup into that patch.

      Arnd

  reply	other threads:[~2026-05-21 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 20:44 Arnd Bergmann
2026-05-21 11:41 ` Christian Brauner
2026-05-21 12:03   ` Arnd Bergmann [this message]
2026-05-21 12:36 ` David Laight
2026-05-21 14:20   ` Arnd Bergmann
2026-06-03  6:16 ` OGAWA Hirofumi
2026-06-03 10:06 ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d75b50e-a233-498c-84ee-bd938ecaeaf9@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=adinata.softwareengineer@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@kernel.org \
    --cc=aviv.daum@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®