HomeFreeBSD

Fix zpool on zvol deadlock

Description

Fix zpool on zvol deadlock

Commit 65d56083b4617a4cade0cff68cbbaf68114169d6 fixes the lock
inversion between spa_namespace_lock and bdev->bd_mutex but only
for the first user of spa_namespace_lock: dmu_objset_own().
Later spa_namespace_lock gets acquired by dsl_prop_get_integer()
though dsl_prop_get()->dsl_dataset_hold()->dsl_dir_open_spa()->
spa_open()->spa_open_common() without this "protection". By
moving the mutex release after this second use, even this
acquisition of the lock is "protected" by the ERESTARTSYS trick.

Signed-off-by: Massimo Maggi <me@massimo-maggi.eu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1220

Details

Provenance
Massimo Maggi <massimo@mmmm.it>Authored on Jan 18 2013, 5:44 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 18 2013, 5:44 PM
Parents
rG7973e464de4f: Revert "Revert "Fix unlink/xattr deadlock""
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGbabf3f9b6d92: Fix zpool on zvol deadlock (authored by Massimo Maggi <massimo@mmmm.it>).Jan 18 2013, 5:44 PM