fs/aio: add configurable AIO_LISTIO_MAX limit

lio_listio() never validated 'nent' against {AIO_LISTIO_MAX}, so a
batch larger than the documented limit was silently accepted, and the
hard-coded _POSIX_AIO_LISTIO_MAX value of 2 was too small for real
workloads (LTP uses 10 entries per call).

Add the FS_AIO_LISTIO_MAX Kconfig option (default 10), use it for
_POSIX_AIO_LISTIO_MAX in include/limits.h, validate 'nent' in
lio_listio(), and report the limit through sysconf(_SC_AIO_LISTIO_MAX).

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2026-09-11 02:21:36 +08:00 • committed by Alan C. Assis
parent 1ea86e65fd
commit 2f4d017bb6
4 changed files with 18 additions and 2 deletions

View file

@ -188,7 +188,7 @@
/* Required for asynchronous I/O */
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_LISTIO_MAX CONFIG_FS_AIO_LISTIO_MAX
#define _POSIX_AIO_MAX 1
/* Required for POSIX message passing */