git: 19cca0b9613d - main - aio: fix the tests when ZFS is not available

Alan Somers asomers at FreeBSD.org
Sun Jan 10 00:17:30 UTC 2021


The branch main has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=19cca0b9613d7c3058e41baf0204245119732235

commit 19cca0b9613d7c3058e41baf0204245119732235
Author:     Alan Somers <asomers at FreeBSD.org>
AuthorDate: 2021-01-10 00:14:55 +0000
Commit:     Alan Somers <asomers at FreeBSD.org>
CommitDate: 2021-01-10 00:16:38 +0000

    aio: fix the tests when ZFS is not available
    
    Don't try to cleanup the zpool if we couldn't create a zpool in the
    first place.
    
    Submitted by:   tmunro
    MFC-with:       022ca2fc7fe08d51f33a1d23a9be49e6d132914e
---
 sys/contrib/openzfs/module/zfs/vdev.c | 1 +
 tests/sys/aio/aio_test.c              | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/sys/contrib/openzfs/module/zfs/vdev.c b/sys/contrib/openzfs/module/zfs/vdev.c
index 7ffe924212da..0b96c52669bd 100644
--- a/sys/contrib/openzfs/module/zfs/vdev.c
+++ b/sys/contrib/openzfs/module/zfs/vdev.c
@@ -3263,6 +3263,7 @@ vdev_load(vdev_t *vd)
 
 	/*
 	 * Recursively load all children.
+	 * TODO: parallelize.
 	 */
 	for (int c = 0; c < vd->vdev_children; c++) {
 		error = vdev_load(vd->vdev_child[c]);
diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c
index f563ec5fa5d9..b34e7c13f5a4 100644
--- a/tests/sys/aio/aio_test.c
+++ b/tests/sys/aio/aio_test.c
@@ -943,6 +943,10 @@ aio_zvol_cleanup(void)
 	char cmd[160];
 
 	pidfile = fopen("pidfile", "r");
+	if (pidfile == NULL && errno == ENOENT) {
+		/* Setup probably failed */
+		return;
+	}
 	ATF_REQUIRE_MSG(NULL != pidfile, "fopen: %s", strerror(errno));
 	ATF_REQUIRE_EQ(1, fscanf(pidfile, "%d", &testpid));
 	fclose(pidfile);


More information about the dev-commits-src-all mailing list