mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
nowait synctask must succeed
If a `zfs_space_check_t` other than `ZFS_SPACE_CHECK_NONE` is used with `dsl_sync_task_nowait()`, the sync task may fail due to ENOSPC. However, there is no way to notice or communicate this failure, so it's extremely difficult to use this functionality correctly, and in fact almost all callers use `ZFS_SPACE_CHECK_NONE`. This commit removes the `zfs_space_check_t` argument from `dsl_sync_task_nowait()`, and always uses `ZFS_SPACE_CHECK_NONE`. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #10855
This commit is contained in:
@@ -1167,8 +1167,8 @@ vdev_remove_replace_with_indirect(vdev_t *vd, uint64_t txg)
|
||||
|
||||
/* After this, we can not use svr. */
|
||||
tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg);
|
||||
dsl_sync_task_nowait(spa->spa_dsl_pool, vdev_remove_complete_sync, svr,
|
||||
0, ZFS_SPACE_CHECK_NONE, tx);
|
||||
dsl_sync_task_nowait(spa->spa_dsl_pool,
|
||||
vdev_remove_complete_sync, svr, tx);
|
||||
dmu_tx_commit(tx);
|
||||
}
|
||||
|
||||
@@ -1317,7 +1317,7 @@ spa_vdev_copy_impl(vdev_t *vd, spa_vdev_removal_t *svr, vdev_copy_arg_t *vca,
|
||||
|
||||
if (svr->svr_max_offset_to_sync[txg & TXG_MASK] == 0) {
|
||||
dsl_sync_task_nowait(dmu_tx_pool(tx), vdev_mapping_sync,
|
||||
svr, 0, ZFS_SPACE_CHECK_NONE, tx);
|
||||
svr, tx);
|
||||
}
|
||||
|
||||
svr->svr_max_offset_to_sync[txg & TXG_MASK] = range_tree_max(segs);
|
||||
@@ -2143,8 +2143,7 @@ spa_vdev_remove_top(vdev_t *vd, uint64_t *txg)
|
||||
vdev_config_dirty(vd);
|
||||
dmu_tx_t *tx = dmu_tx_create_assigned(spa->spa_dsl_pool, *txg);
|
||||
dsl_sync_task_nowait(spa->spa_dsl_pool,
|
||||
vdev_remove_initiate_sync,
|
||||
(void *)(uintptr_t)vd->vdev_id, 0, ZFS_SPACE_CHECK_NONE, tx);
|
||||
vdev_remove_initiate_sync, (void *)(uintptr_t)vd->vdev_id, tx);
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user