mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-02-05 06:43:31 +03:00
ztest: Fix ASSERT in ztest_objset_destroy_cb()
The dsl_destroy_snapshot() call in ztest_objset_destroy_cb() may encounter a runtime error when the pool is out of space. This is similar to the error handling for the dsl_destroy_head() case, but since dsl_destroy_snapshot() is implemented as a channel program ECHRNG is returned instead of ENOSPC. ECHRNG may also be returned instead of EBUSY if there is a hold on the snapshot. Reviewed by: George Melikov <mail@gmelikov.ru> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #13155
This commit is contained in:
parent
4f453dcc1f
commit
ce91f973ec
@ -4273,7 +4273,15 @@ ztest_objset_destroy_cb(const char *name, void *arg)
|
|||||||
* Destroy the dataset.
|
* Destroy the dataset.
|
||||||
*/
|
*/
|
||||||
if (strchr(name, '@') != NULL) {
|
if (strchr(name, '@') != NULL) {
|
||||||
VERIFY0(dsl_destroy_snapshot(name, B_TRUE));
|
error = dsl_destroy_snapshot(name, B_TRUE);
|
||||||
|
if (error != ECHRNG) {
|
||||||
|
/*
|
||||||
|
* The program was executed, but encountered a runtime
|
||||||
|
* error, such as insufficient slop, or a hold on the
|
||||||
|
* dataset.
|
||||||
|
*/
|
||||||
|
ASSERT0(error);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
error = dsl_destroy_head(name);
|
error = dsl_destroy_head(name);
|
||||||
if (error == ENOSPC) {
|
if (error == ENOSPC) {
|
||||||
|
Loading…
Reference in New Issue
Block a user