]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ztest: ENOSPC in ztest_objset_destroy_cb()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 Dec 2018 18:03:05 +0000 (10:03 -0800)
committerGitHub <noreply@github.com>
Fri, 14 Dec 2018 18:03:05 +0000 (10:03 -0800)
While unlikely it is possible for dsl_destroy_head() to return
ENOSPC in the ztest_objset_destroy_cb().  This can occur even
when ZFS_SPACE_CHECK_DESTROY is used with the dsl_sync_task().
Both the existence of a checkpoint and pending deferred frees
can cause this.

Reviewed-by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8206

cmd/ztest/ztest.c

index c4bcd74fc0d2e993169bdaae8f99df9678724b20..28ab0e8469c28fb641b52305987946780a34a80b 100644 (file)
@@ -3980,9 +3980,13 @@ ztest_objset_destroy_cb(const char *name, void *arg)
                VERIFY0(dsl_destroy_snapshot(name, B_TRUE));
        } else {
                error = dsl_destroy_head(name);
-               /* There could be a hold on this dataset */
-               if (error != EBUSY)
+               if (error == ENOSPC) {
+                       /* There could be checkpoint or insufficient slop */
+                       ztest_record_enospc(FTAG);
+               } else if (error != EBUSY) {
+                       /* There could be a hold on this dataset */
                        ASSERT0(error);
+               }
        }
        return (0);
 }