Date: Tue, 7 Oct 2025 21:57:35 GMT From: Olivier Cochard <olivier@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 2e09ec72417c - main - tests/aio: Add support for larger max_buf_aio to vectored_big_iovcnt test Message-ID: <202510072157.597LvZWR099245@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=2e09ec72417c6c2927185f4d63faea9ac7926c2b commit 2e09ec72417c6c2927185f4d63faea9ac7926c2b Author: Olivier Cochard <olivier@FreeBSD.org> AuthorDate: 2025-10-07 21:45:35 +0000 Commit: Olivier Cochard <olivier@FreeBSD.org> CommitDate: 2025-10-07 21:56:23 +0000 tests/aio: Add support for larger max_buf_aio to vectored_big_iovcnt test Fix a test failure that occurs when max_buf_aio exceeds 31, as the calculated buffer size exceeds the 16 KB memory disk device. Increase the MD device size to 1 MB to prevent truncation. Rename MD_LEN to DEVICE_IO_LEN for clarity and add a more descriptive error message. Reviewed by: asomers Approved by: asomers Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D52914 --- tests/sys/aio/aio_test.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index b9f8e7062203..def8a9d548d6 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -775,7 +775,7 @@ ATF_TC_BODY(pipe_waitcomplete, tc) aio_pipe_test(waitcomplete, NULL); } -#define MD_LEN GLOBAL_MAX +#define DEVICE_IO_LEN GLOBAL_MAX #define MDUNIT_LINK "mdunit_link" static int @@ -794,7 +794,7 @@ aio_md_setup(void) mdio.md_version = MDIOVERSION; mdio.md_type = MD_MALLOC; mdio.md_options = MD_AUTOUNIT | MD_COMPRESS; - mdio.md_mediasize = GLOBAL_MAX; + mdio.md_mediasize = 1024 * 1024; /* 1 MB, enough for max_buf_aio up to 2047 */ mdio.md_sectorsize = 512; strlcpy(buf, __func__, sizeof(buf)); mdio.md_label = buf; @@ -856,7 +856,7 @@ aio_md_test(completion comp, struct sigevent *sev, bool vectored) int fd; fd = aio_md_setup(); - aio_context_init(&ac, fd, fd, MD_LEN); + aio_context_init(&ac, fd, fd, DEVICE_IO_LEN); if (vectored) { aio_writev_test(&ac, comp, sev); aio_readv_test(&ac, comp, sev); @@ -1846,7 +1846,9 @@ ATF_TC_BODY(vectored_big_iovcnt, tc) atf_tc_fail("aio failed: %s", strerror(errno)); if (len != buflen) - atf_tc_fail("aio short write (%jd)", (intmax_t)len); + atf_tc_fail("aio short write: got %jd, expected: %jd " + "(max_buf_aio=%d, iovcnt=%zu)", + (intmax_t)len, (intmax_t)buflen, max_buf_aio, aio.aio_iovcnt); bzero(&aio, sizeof(aio)); aio.aio_fildes = fd; @@ -1995,7 +1997,7 @@ aio_zvol_test(completion comp, struct sigevent *sev, bool vectored, int fd; fd = aio_zvol_setup(unique); - aio_context_init(&ac, fd, fd, MD_LEN); + aio_context_init(&ac, fd, fd, DEVICE_IO_LEN); if (vectored) { aio_writev_test(&ac, comp, sev); aio_readv_test(&ac, comp, sev);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510072157.597LvZWR099245>