diff options
author | mm <mm@FreeBSD.org> | 2010-06-12 11:24:10 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2010-06-12 11:24:10 +0000 |
commit | b9b5f9e6aa1087bbbfbfe34b4010b9642245e835 (patch) | |
tree | 2615947df4d473d1634aef087bd92338bdbfd9cb /sys/cddl/contrib | |
parent | e8fb0ae71d3ceec0a6fba815efb182b52e5ba1d7 (diff) | |
download | FreeBSD-src-b9b5f9e6aa1087bbbfbfe34b4010b9642245e835.zip FreeBSD-src-b9b5f9e6aa1087bbbfbfe34b4010b9642245e835.tar.gz |
Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock
OpenSolaris onnv-revision: 9997:174d75a29a1c
Obtained from: OpenSolaris (Bug ID 6843235)
Approved by: pjd, delphij (mentor)
MFC after: 3 days
Diffstat (limited to 'sys/cddl/contrib')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c index dededdf..84561ab 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c @@ -1008,6 +1008,8 @@ dsl_pool_scrub_clean_cb(dsl_pool_t *dp, int dsl_pool_scrub_clean(dsl_pool_t *dp) { + spa_t *spa = dp->dp_spa; + /* * Purge all vdev caches. We do this here rather than in sync * context because this requires a writer lock on the spa_config @@ -1015,11 +1017,11 @@ dsl_pool_scrub_clean(dsl_pool_t *dp) * spa_scrub_reopen flag indicates that vdev_open() should not * attempt to start another scrub. */ - spa_config_enter(dp->dp_spa, SCL_ALL, FTAG, RW_WRITER); - dp->dp_spa->spa_scrub_reopen = B_TRUE; - vdev_reopen(dp->dp_spa->spa_root_vdev); - dp->dp_spa->spa_scrub_reopen = B_FALSE; - spa_config_exit(dp->dp_spa, SCL_ALL, FTAG); + spa_vdev_state_enter(spa); + spa->spa_scrub_reopen = B_TRUE; + vdev_reopen(spa->spa_root_vdev); + spa->spa_scrub_reopen = B_FALSE; + (void) spa_vdev_state_exit(spa, NULL, 0); return (dsl_pool_scrub_setup(dp, SCRUB_FUNC_CLEAN)); } |