]> git.proxmox.com Git - mirror_zfs.git/commit
Fix lock inversion in txg_sync_thread()
authorTom Caputi <tcaputi@datto.com>
Tue, 16 Oct 2018 21:00:55 +0000 (17:00 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Oct 2018 21:37:02 +0000 (14:37 -0700)
commita783dd96843699744e0543b579b5f50c9023432f
treeed3ee0c03f7b8acffb29689b93a485cbcf6d6ed3
parentab4c009e3d0cf794bbe84aff3b9ac203eaed03c7
Fix lock inversion in txg_sync_thread()

This patch fixes a lock inversion issue in txg_sync_thread() where
the code would attempt hold the spa config lock as a reader while
holding tx->tx_sync_lock. This races with spa_vdev_remove() which
attempts to hold the tx->tx_sync_lock to assign a new tx (via
spa_history_log_internal()) while holding the spa config lock as a
writer.

Reviewed-by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8010
module/zfs/txg.c