diff options
author | Serapheim Dimitropoulos <[email protected]> | 2019-01-13 10:09:46 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-01-13 10:09:46 -0800 |
commit | 61c3391acc988573aaf9e59550f863de4affcb68 (patch) | |
tree | 915910c51e0bef4cf4ee0d792c75602e3d814ea3 /module/zfs/spa_checkpoint.c | |
parent | 83c796c5e9d9ecb28e9553338f079a5d6b015b10 (diff) |
Serialize ZTHR operations to eliminate races
Adds a new lock for serializing operations on zthrs.
The commit also includes some code cleanup and
refactoring.
Reviewed by: Matt Ahrens <[email protected]>
Reviewed by: Tom Caputi <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Serapheim Dimitropoulos <[email protected]>
Closes #8229
Diffstat (limited to 'module/zfs/spa_checkpoint.c')
-rw-r--r-- | module/zfs/spa_checkpoint.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/module/zfs/spa_checkpoint.c b/module/zfs/spa_checkpoint.c index 863ec46b1..230ae5785 100644 --- a/module/zfs/spa_checkpoint.c +++ b/module/zfs/spa_checkpoint.c @@ -393,7 +393,7 @@ spa_checkpoint_discard_thread_check(void *arg, zthr_t *zthr) return (B_TRUE); } -int +void spa_checkpoint_discard_thread(void *arg, zthr_t *zthr) { spa_t *spa = arg; @@ -408,7 +408,7 @@ spa_checkpoint_discard_thread(void *arg, zthr_t *zthr) dmu_buf_t **dbp; if (zthr_iscancelled(zthr)) - return (0); + return; ASSERT3P(vd->vdev_ops, !=, &vdev_indirect_ops); @@ -445,8 +445,6 @@ spa_checkpoint_discard_thread(void *arg, zthr_t *zthr) VERIFY0(dsl_sync_task(spa->spa_name, NULL, spa_checkpoint_discard_complete_sync, spa, 0, ZFS_SPACE_CHECK_NONE)); - - return (0); } |