Skip to content

Commit

Permalink
mmp should use a fixed tag for spa_config locks
Browse files Browse the repository at this point in the history
mmp_write_uberblock() and mmp_write_done() should the same tag
for spa_config_locks.

Reviewed-by: Olaf Faaland <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: Sanjeev Bagewadi <[email protected]>
Closes #6530 
Closes #7155
  • Loading branch information
sanjeevbagewadi authored and behlendorf committed Feb 12, 2018
1 parent ba779f7 commit 918dbe3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions module/zfs/mmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ uint_t zfs_multihost_import_intervals = MMP_DEFAULT_IMPORT_INTERVALS;
*/
uint_t zfs_multihost_fail_intervals = MMP_DEFAULT_FAIL_INTERVALS;

char *mmp_tag = "mmp_write_uberblock";
static void mmp_thread(void *arg);

void
Expand Down Expand Up @@ -278,7 +279,7 @@ mmp_write_done(zio_t *zio)

unlock:
mutex_exit(&mts->mmp_io_lock);
spa_config_exit(spa, SCL_STATE, FTAG);
spa_config_exit(spa, SCL_STATE, mmp_tag);

abd_free(zio->io_abd);
}
Expand Down Expand Up @@ -314,7 +315,7 @@ mmp_write_uberblock(spa_t *spa)
int label;
uint64_t offset;

spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
spa_config_enter(spa, SCL_STATE, mmp_tag, RW_READER);
vd = mmp_random_leaf(spa->spa_root_vdev);
if (vd == NULL) {
spa_config_exit(spa, SCL_STATE, FTAG);
Expand Down

0 comments on commit 918dbe3

Please sign in to comment.