udf: Allocate name buffer in directory iterator on heap
authorJan Kara <jack@suse.cz>
Tue, 20 Dec 2022 11:38:45 +0000 (12:38 +0100)
committerJan Kara <jack@suse.cz>
Mon, 9 Jan 2023 09:39:53 +0000 (10:39 +0100)
commit0aba4860b0d0216a1a300484ff536171894d49d8
tree27697bed83fd7762bc3ab8e7efeba20a38696aec
parent19fd80de0a8b5170ef34704c8984cca920dffa59
udf: Allocate name buffer in directory iterator on heap

Currently we allocate name buffer in directory iterators (struct
udf_fileident_iter) on stack. These structures are relatively large
(some 360 bytes on 64-bit architectures). For udf_rename() which needs
to keep three of these structures in parallel the stack usage becomes
rather heavy - 1536 bytes in total. Allocate the name buffer in the
iterator from heap to avoid excessive stack usage.

Link: https://lore.kernel.org/all/202212200558.lK9x1KW0-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/directory.c
fs/udf/udfdecl.h