HomeFreeBSD

Fix overly broad locking in spa_vdev_config_exit()

Description

Fix overly broad locking in spa_vdev_config_exit()

Calling vdev_free() only requires the we acquire the spa config
SCL_STATE_ALL locks, not the SCL_ALL locks. In particular, we need
need to avoid taking the SCL_CONFIG lock (included in SCL_ALL) as a
writer since this can lead to a deadlock. The txg_sync_thread() may
block in spa_txg_history_init_io() when taking the SCL_CONFIG lock
as a reading when it detects there's a pending writer.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11585

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Feb 24 2021, 6:00 PM
GitHub <noreply@github.com>Committed on Feb 24 2021, 6:00 PM
Parents
rG3ee4e6d8b792: vdev_id: Fix partition regular expression
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG75a089ed34be: Fix overly broad locking in spa_vdev_config_exit() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Feb 24 2021, 6:00 PM