diff options
author | George Wilson <[email protected]> | 2016-11-05 20:43:56 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-03-23 18:20:58 -0700 |
commit | 55922e73b4294fc6c3014be27b61201b7962088c (patch) | |
tree | dc5d76284e608ca16d81b5b1adb0b4aeb668c8de /module/zfs/spa.c | |
parent | 56a6054d553fd7f1cf7d7c86bf4b33951e1d009f (diff) |
OpenZFS 3821 - Race in rollback, zil close, and zil flush
Authored by: George Wilson <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Reviewed by: Pavel Zakharov <[email protected]>
Reviewed by: Andriy Gapon <[email protected]>
Approved by: Richard Lowe <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Ported-by: George Melikov <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/3821
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/43297f9
Closes #5905
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r-- | module/zfs/spa.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c index d632d635e..f573fe0d7 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -6749,8 +6749,6 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_config_syncing = NULL; } - spa->spa_ubsync = spa->spa_uberblock; - dsl_pool_sync_done(dp, txg); mutex_enter(&spa->spa_alloc_lock); @@ -6775,6 +6773,13 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_pass = 0; + /* + * Update the last synced uberblock here. We want to do this at + * the end of spa_sync() so that consumers of spa_last_synced_txg() + * will be guaranteed that all the processing associated with + * that txg has been completed. + */ + spa->spa_ubsync = spa->spa_uberblock; spa_config_exit(spa, SCL_CONFIG, FTAG); spa_handle_ignored_writes(spa); |