]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Fix LOR between dp_config_rwlock and spa_props_lock
authorAlexander Motin <mav@FreeBSD.org>
Tue, 14 Jul 2020 19:21:57 +0000 (15:21 -0400)
committerGitHub <noreply@github.com>
Tue, 14 Jul 2020 19:21:57 +0000 (12:21 -0700)
commit1743c737f5ad6e2c6c429858b7c0f717ecb20954
tree87da399170b38d8197ede250343e509c7f943b2e
parent5f72109e5bd84124bd6dd9877fae3fa9ae7ee348
Fix LOR between dp_config_rwlock and spa_props_lock

Our QE team during automated API testing hit deadlock in ZFS, caused
by lock order reversal.  From one side dsl_sync_task_sync() locks
dp_config_rwlock as writer and calls spa_sync_props(), which waits
for spa_props_lock.  From another spa_prop_get() locks spa_props_lock
and then calls dsl_pool_config_enter(), trying to lock dp_config_rwlock
as reader.

This patch makes spa_prop_get() lock dp_config_rwlock before
spa_props_lock, making the order consistent.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #10553
module/zfs/spa.c