mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 03:45:02 +01:00
zvol: Fix suspend lock leaks (#16270)
In several functions, we use a flag variable to track whether zv_suspend_lock is held. This flag was not getting reset in a particular case where we need to retry the underlying operation, resulting in a lock leak. Make sure to update the flag where necessary. Signed-off-by: Mark Johnston <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: Tony Hutter <[email protected]>
This commit is contained in:
1 parent
326040b285
commit
4367312760
2 files changed
+3
No files matched your search
@@ -292,6 +292,7 @@ retry:
|
||||
if (!mutex_tryenter(&spa_namespace_lock)) {
|
||||
mutex_exit(&zv->zv_state_lock);
|
||||
rw_exit(&zv->zv_suspend_lock);
|
||||
drop_suspend = B_FALSE;
|
||||
kern_yield(PRI_USER);
|
||||
goto retry;
|
||||
} else {
|
||||
@@ -983,6 +984,7 @@ retry:
|
||||
if (!mutex_tryenter(&spa_namespace_lock)) {
|
||||
mutex_exit(&zv->zv_state_lock);
|
||||
rw_exit(&zv->zv_suspend_lock);
|
||||
drop_suspend = B_FALSE;
|
||||
kern_yield(PRI_USER);
|
||||
goto retry;
|
||||
} else {
|
||||
|
||||
@@ -791,6 +791,7 @@ retry:
|
||||
if (!mutex_tryenter(&spa_namespace_lock)) {
|
||||
mutex_exit(&zv->zv_state_lock);
|
||||
rw_exit(&zv->zv_suspend_lock);
|
||||
drop_suspend = B_FALSE;
|
||||
|
||||
#ifdef HAVE_BLKDEV_GET_ERESTARTSYS
|
||||
schedule();
|
||||
|
||||
Reference in new issue
Block a user