]> git.ipfire.org Git - thirdparty/linux.git/commit
bcachefs: ioctl: avoid stack overflow warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Jun 2025 09:24:04 +0000 (11:24 +0200)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 12 Jun 2025 03:21:30 +0000 (23:21 -0400)
commite82b3a63a9a91cc5c585efb3e28f32100f24e3e1
treed39c501123601ef9c883b6973ad3c041b3f00a36
parentc3dd25319c1818e067f41f41127f935f153498e6
bcachefs: ioctl: avoid stack overflow warning

Multiple ioctl handlers individually use a lot of stack space, and clang chooses
to inline them into the bch2_fs_ioctl() function, blowing through the warning
limit:

fs/bcachefs/chardev.c:655:6: error: stack frame size (1032) exceeds limit (1024) in 'bch2_fs_ioctl' [-Werror,-Wframe-larger-than]
  655 | long bch2_fs_ioctl(struct bch_fs *c, unsigned cmd, void __user *arg)

By marking the largest two of them as noinline_for_stack, no indidual code path
ends up using this much, which avoids the warning and reduces the possible
total stack usage in the ioctl handler.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/chardev.c