diff options
author | Matthew Ahrens <[email protected]> | 2020-09-04 10:29:39 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-04 10:29:39 -0700 |
commit | 3808032489f28c1f36b39c9a3274d5f4b6f9638a (patch) | |
tree | 34b2a72f5452c097da400b3571443bf3e671ee93 /module/zfs/vdev_rebuild.c | |
parent | cd80273909184426d5f38050c3163de43031098f (diff) |
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 <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #10855
Diffstat (limited to 'module/zfs/vdev_rebuild.c')
-rw-r--r-- | module/zfs/vdev_rebuild.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/module/zfs/vdev_rebuild.c b/module/zfs/vdev_rebuild.c index 85ed8afe1..3362d608c 100644 --- a/module/zfs/vdev_rebuild.c +++ b/module/zfs/vdev_rebuild.c @@ -267,7 +267,7 @@ vdev_rebuild_initiate(vdev_t *vd) vd->vdev_rebuilding = B_TRUE; dsl_sync_task_nowait(spa_get_dsl(spa), vdev_rebuild_initiate_sync, - (void *)(uintptr_t)vd->vdev_id, 0, ZFS_SPACE_CHECK_NONE, tx); + (void *)(uintptr_t)vd->vdev_id, tx); dmu_tx_commit(tx); vdev_rebuild_log_notify(spa, vd, ESC_ZFS_RESILVER_START); @@ -553,8 +553,7 @@ vdev_rebuild_range(vdev_rebuild_t *vr, uint64_t start, uint64_t size) vr->vr_scan_offset[txg & TXG_MASK] = start; dsl_sync_task_nowait(spa_get_dsl(spa), vdev_rebuild_update_sync, - (void *)(uintptr_t)vd->vdev_id, 2, - ZFS_SPACE_CHECK_RESERVED, tx); + (void *)(uintptr_t)vd->vdev_id, tx); } /* When exiting write out our progress. */ @@ -875,16 +874,14 @@ vdev_rebuild_thread(void *arg) * by a pool checkpoint. See the dsl_scan_done() comments. */ dsl_sync_task_nowait(dp, vdev_rebuild_complete_sync, - (void *)(uintptr_t)vd->vdev_id, 0, - ZFS_SPACE_CHECK_NONE, tx); + (void *)(uintptr_t)vd->vdev_id, tx); } else if (vd->vdev_rebuild_cancel_wanted) { /* * The rebuild operation was canceled. This will occur when * a device participating in the rebuild is detached. */ dsl_sync_task_nowait(dp, vdev_rebuild_cancel_sync, - (void *)(uintptr_t)vd->vdev_id, 0, - ZFS_SPACE_CHECK_NONE, tx); + (void *)(uintptr_t)vd->vdev_id, tx); } else if (vd->vdev_rebuild_reset_wanted) { /* * Reset the running rebuild without canceling and restarting @@ -892,8 +889,7 @@ vdev_rebuild_thread(void *arg) * participate in the rebuild. */ dsl_sync_task_nowait(dp, vdev_rebuild_reset_sync, - (void *)(uintptr_t)vd->vdev_id, 0, - ZFS_SPACE_CHECK_NONE, tx); + (void *)(uintptr_t)vd->vdev_id, tx); } else { /* * The rebuild operation should be suspended. This may occur |