zfs destroy may be unable to free space in full pools
Typically destroy operations result in a net free of space and should always be allowed to prevent situations where not even the storage administrator can restore a full ZFS pool to a functioning state. Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
This commit is contained in:
parent
a3403164d7
commit
b98a0fce28
|
@ -235,7 +235,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));
|
||||
|
|
|
@ -394,7 +394,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue