git: 47e46b1123b9 - main - zfs: Fix zvol_cdev_open locking
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Jan 2022 18:38:29 UTC
The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=47e46b1123b9c732c366848e8184ce42e086a0fb commit 47e46b1123b9c732c366848e8184ce42e086a0fb Author: Ryan Moeller <freqlabs@FreeBSD.org> AuthorDate: 2022-01-26 18:33:23 +0000 Commit: Ryan Moeller <freqlabs@FreeBSD.org> CommitDate: 2022-01-26 18:37:52 +0000 zfs: 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. This change has been accepted upstream in openzfs/zfs#13016 but is not yet merged. Reviewed by: mav Fixes: e92ffd9b6268 Sponsored by: iXsystems, Inc. --- sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c index 8785557cb61d..06dd8cfdd790 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c @@ -928,8 +928,8 @@ retry: */ if (!mutex_owned(&spa_namespace_lock)) { if (!mutex_tryenter(&spa_namespace_lock)) { - rw_exit(&zvol_state_lock); - mutex_enter(&spa_namespace_lock); + mutex_exit(&zv->zv_state_lock); + rw_exit(&zv->zv_suspend_lock); kern_yield(PRI_USER); goto retry; } else {