Skip to content

Commit

Permalink
Fix manual TRIM race
Browse files Browse the repository at this point in the history
Before a metaslab can be unmarked and new allocations allowed, all
inflight TRIMs still being handled need to be complete.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information
behlendorf committed Feb 23, 2019
1 parent b767102 commit 27807b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/zfs/vdev_trim.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,13 @@ vdev_trim_thread(void *arg)

spa_config_exit(spa, SCL_CONFIG, FTAG);
error = vdev_trim_ranges(&ta);

/*
* Wait for any trims which have been issued to be
* synced before allowing new allocations to occur.
*/
txg_wait_synced(spa->spa_dsl_pool, 0);

vdev_trim_ms_unmark(msp);
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);

Expand Down

0 comments on commit 27807b2

Please sign in to comment.