ocfs2: reduce ioctl stack usage
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Apr 2023 20:56:24 +0000 (22:56 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 21 Apr 2023 21:54:34 +0000 (14:54 -0700)
commit09d49eb90fc8d03e1dab62dd7060389040f1d32b
tree7d1a67b38e7ae68a224745dcf56d3c7bc7cef435
parent522dc4e5f51e3d51c4ff55ad1c725d12176b71ea
ocfs2: reduce ioctl stack usage

On 32-bit architectures with KASAN_STACK enabled, the total stack usage of
the ocfs2_ioctl function grows beyond the warning limit:

fs/ocfs2/ioctl.c: In function 'ocfs2_ioctl':
fs/ocfs2/ioctl.c:934:1: error: the frame size of 1448 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

Move each of the variables into a basic block, and mark
ocfs2_info_handle() as noinline_for_stack, in order to have the variable
share stack slots.

Link: https://lkml.kernel.org/r/20230417205631.1956027-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/ioctl.c