]> granicus.if.org Git - zfs/commitdiff
Fix ztest_vdev_add_remove() test case
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 14 Jun 2018 16:41:27 +0000 (09:41 -0700)
committerGitHub <noreply@github.com>
Thu, 14 Jun 2018 16:41:27 +0000 (09:41 -0700)
Commit 2ffd89fc allowed two new errors to be reported by zil_reset()
in order to provide a descriptive error message regarding why a log
device could not be removed.  However, the new return values were
not handled in the ztest_vdev_add_remove() test case resulting in
ztest failures during automated testing.

Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7630

cmd/ztest/ztest.c

index bbd30c9e022765f91eed6736ca10fc5b9fb0d39e..83a8b4f3ccef30c0e8d31be5478190d066f14271 100644 (file)
@@ -2948,8 +2948,15 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
                error = spa_vdev_remove(spa, guid, B_FALSE);
                pthread_rwlock_unlock(&ztest_name_lock);
 
-               if (error && error != EEXIST)
+               switch (error) {
+               case 0:
+               case EEXIST:    /* Generic zil_reset() error */
+               case EBUSY:     /* Replay required */
+               case EACCES:    /* Crypto key not loaded */
+                       break;
+               default:
                        fatal(0, "spa_vdev_remove() = %d", error);
+               }
        } else {
                spa_config_exit(spa, SCL_VDEV, FTAG);