Page MenuHomeFreeBSD

D52914.id163581.diff
No OneTemporary

D52914.id163581.diff

Index: sys/aio/aio_test.c
===================================================================
--- sys/aio/aio_test.c
+++ sys/aio/aio_test.c
@@ -845,6 +845,7 @@
}
}
}
+ unlink(MDUNIT_LINK);
close(mdctl_fd);
}
@@ -1822,6 +1823,17 @@
seed = random();
buflen = 512 * (max_buf_aio + 1);
+
+ /*
+ * Limit buflen to MD device size to prevent short writes.
+ * The test's goal is to verify vectored AIO with iovcnt > max_buf_aio,
+ * not to test writes exceeding device capacity.
+ */
+ if (buflen > GLOBAL_MAX) {
+ buflen = GLOBAL_MAX;
+ max_buf_aio = (GLOBAL_MAX / 512) - 1;
+ }
+
buffer = malloc(buflen);
aio_fill_buffer(buffer, buflen, seed);
iov = calloc(max_buf_aio + 1, sizeof(struct iovec));
@@ -1846,7 +1858,9 @@
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;

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 22, 2:05 PM (7 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35366475
Default Alt Text
D52914.id163581.diff (1 KB)

Event Timeline