diff options
author | Brian Behlendorf <[email protected]> | 2018-06-14 09:41:27 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-14 09:41:27 -0700 |
commit | c91cf36fc23f66efd9de5738b62cf8dec87f15ce (patch) | |
tree | 37cd0ec081b37644f1cc37d7f12a20aa7edd2635 | |
parent | 1fac63e56f370f675b23687ee2e634744c54e818 (diff) |
Fix ztest_vdev_add_remove() test case
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 <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Paul Zuchowski <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7630
-rw-r--r-- | cmd/ztest/ztest.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index bbd30c9e0..83a8b4f3c 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -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); |