FreeBSD: Fix zvol_cdev_open locking
First open locking changes were correctly applied to zvol_geom_open but incorrectly applied to zvol_cdev_open, causing spa_namespace_lock to be held indefinitely. Make the first open locking in zvol_cdev_open match zvol_geom_open. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #13016
This commit is contained in:
parent
1828b68a0b
commit
af1630c883
|
@ -928,8 +928,8 @@ retry:
|
||||||
*/
|
*/
|
||||||
if (!mutex_owned(&spa_namespace_lock)) {
|
if (!mutex_owned(&spa_namespace_lock)) {
|
||||||
if (!mutex_tryenter(&spa_namespace_lock)) {
|
if (!mutex_tryenter(&spa_namespace_lock)) {
|
||||||
rw_exit(&zvol_state_lock);
|
mutex_exit(&zv->zv_state_lock);
|
||||||
mutex_enter(&spa_namespace_lock);
|
rw_exit(&zv->zv_suspend_lock);
|
||||||
kern_yield(PRI_USER);
|
kern_yield(PRI_USER);
|
||||||
goto retry;
|
goto retry;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue