diff options
author | Pavel Zakharov <pavel.zakharov@delphix.com> | 2016-10-19 17:46:08 -0400 |
---|---|---|
committer | Prakash Surya <prakash.surya@delphix.com> | 2018-03-19 11:21:36 -0700 |
commit | d1de72cfa29ab77ff80e2bb0e668a6afa5bccaf0 (patch) | |
tree | 3d1067ad5154908c6c6aee9f8d323d422f51b496 | |
parent | 859bfead58cf0e8c589b713386bab81385a346e6 (diff) | |
download | illumos-joyent-d1de72cfa29ab77ff80e2bb0e668a6afa5bccaf0.tar.gz |
9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r-- | usr/src/uts/common/fs/zfs/vdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index d7434c7ddc..388d13716c 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -1573,8 +1573,11 @@ vdev_validate(vdev_t *vd) /* * If we are performing an extreme rewind, we allow for a label that * was modified at a point after the current txg. + * If config lock is not held do not check for the txg. spa_sync could + * be updating the vdev's label before updating spa_last_synced_txg. */ - if (spa->spa_extreme_rewind || spa_last_synced_txg(spa) == 0) + if (spa->spa_extreme_rewind || spa_last_synced_txg(spa) == 0 || + spa_config_held(spa, SCL_CONFIG, RW_WRITER) != SCL_CONFIG) txg = UINT64_MAX; else txg = spa_last_synced_txg(spa); |