diff --git a/module/zfs/dsl_synctask.c b/module/zfs/dsl_synctask.c index 409e12884d..86d8ba5595 100644 --- a/module/zfs/dsl_synctask.c +++ b/module/zfs/dsl_synctask.c @@ -231,7 +231,7 @@ dsl_sync_task_sync(dsl_sync_task_t *dst, dmu_tx_t *tx) uint64_t used = dsl_dir_phys(dp->dp_root_dir)->dd_used_bytes; /* MOS space is triple-dittoed, so we multiply by 3. */ - if (used + dst->dst_space * 3 > quota) { + if (dst->dst_space > 0 && used + dst->dst_space * 3 > quota) { dst->dst_error = SET_ERROR(ENOSPC); if (dst->dst_nowaiter) kmem_free(dst, sizeof (*dst)); diff --git a/module/zfs/zcp_synctask.c b/module/zfs/zcp_synctask.c index 058910054d..fa12678c95 100644 --- a/module/zfs/zcp_synctask.c +++ b/module/zfs/zcp_synctask.c @@ -532,7 +532,7 @@ zcp_synctask_wrapper(lua_State *state) uint64_t used = dsl_dir_phys(dp->dp_root_dir)->dd_used_bytes + ri->zri_space_used; - if (used + funcspace > quota) { + if (funcspace > 0 && used + funcspace > quota) { err = SET_ERROR(ENOSPC); } }