diff options
author | Fabian Frederick <[email protected]> | 2023-05-06 06:56:12 +0200 |
---|---|---|
committer | Christian Brauner <[email protected]> | 2023-05-15 12:43:15 +0200 |
commit | 1168f095417643f663caa341211e117db552989f (patch) | |
tree | 09120f6775f40a32c5b0d1e294e4b979eb5e6933 /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | 55650b2fddb958e42036c5b07ed82983ce532865 (diff) |
jffs2: reduce stack usage in jffs2_build_xattr_subsystem()
Use kcalloc() for allocation/flush of 128 pointers table to
reduce stack usage.
Function now returns -ENOMEM or 0 on success.
stackusage
Before:
./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 1208
dynamic,bounded
After:
./fs/jffs2/xattr.c:775 jffs2_build_xattr_subsystem 192
dynamic,bounded
Also update definition when CONFIG_JFFS2_FS_XATTR is not enabled
Tested with an MTD mount point and some user set/getfattr.
Many current target on OpenWRT also suffer from a compilation warning
(that become an error with CONFIG_WERROR) with the following output:
fs/jffs2/xattr.c: In function 'jffs2_build_xattr_subsystem':
fs/jffs2/xattr.c:887:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
887 | }
| ^
Using dynamic allocation fix this compilation warning.
Fixes: c9f700f840bd ("[JFFS2][XATTR] using 'delete marker' for xdatum/xref deletion")
Reported-by: Tim Gardner <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reported-by: Ron Economos <[email protected]>
Reported-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Christian Marangi <[email protected]>
Cc: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions