Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel initialize and TRIM before vdev_metaslab_fini() #9751

Merged
merged 1 commit into from
Dec 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions module/zfs/vdev_removal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,13 @@ spa_vdev_remove_log(vdev_t *vd, uint64_t *txg)
spa_vdev_config_exit(spa, NULL,
*txg + TXG_CONCURRENT_STATES + TXG_DEFER_SIZE, 0, FTAG);

/*
* Cancel any initialize or TRIM which was in progress.
*/
vdev_initialize_stop_all(vd, VDEV_INITIALIZE_CANCELED);
vdev_trim_stop_all(vd, VDEV_TRIM_CANCELED);
vdev_autotrim_stop_wait(vd);

/*
* Evacuate the device. We don't hold the config lock as
* writer since we need to do I/O but we do keep the
Expand Down Expand Up @@ -1921,12 +1928,6 @@ spa_vdev_remove_log(vdev_t *vd, uint64_t *txg)
spa_log_sm_set_blocklimit(spa);

spa_vdev_config_exit(spa, NULL, *txg, 0, FTAG);

/* Stop initializing and TRIM */
vdev_initialize_stop_all(vd, VDEV_INITIALIZE_CANCELED);
vdev_trim_stop_all(vd, VDEV_TRIM_CANCELED);
vdev_autotrim_stop_wait(vd);

*txg = spa_vdev_config_enter(spa);

sysevent_t *ev = spa_event_create(spa, vd, NULL,
Expand Down