[Devel] [PATCH RHEL9 COMMIT] fs/fuse kio: fix lock leak in pcs_cs_find_create()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Dec 8 15:25:40 MSK 2025


The commit is pushed to "branch-rh9-5.14.0-427.92.1.vz9.88.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.92.1.vz9.88.10
------>
commit 85c78c6cdfdbb907f425a1174c2fbb0eca07f5e2
Author: Liu Kui <kui.liu at virtuozzo.com>
Date:   Mon Dec 8 17:17:36 2025 +0800

    fs/fuse kio: fix lock leak in pcs_cs_find_create()
    
    In pcs_cs_find_create(), when __lookup_cs() finds an existing cs
    during the creation path, cs->lock is acquired but not released
    before calling pcs_cs_destroy(cs) and jumping to 'again'.
    
    This lock leak can trigger "BUG: workqueue leaked lock or atomic"
    errors when called from the workqueue function fuse_complete_map_work().
    Holding a spin_lock makes the kworker unschedulable, which violates
    workqueue execution requirements.
    
    Fixes: 8ff5cf135a0f0 ("fs: fuse: pcs: implement dislog")
    https://virtuozzo.atlassian.net/browse/VSTOR-120551
    
    Signed-off-by: Liu Kui <kui.liu at virtuozzo.com>
    
    Feature: vStorage
---
 fs/fuse/kio/pcs/pcs_cs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 47b733636c1d7..8236b0ea1d253 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -253,6 +253,7 @@ struct pcs_cs *pcs_cs_find_create(struct pcs_cs_set *csset, PCS_NODE_ID_T *id, P
 	if (__lookup_cs(csset, id->val)) {
 		spin_unlock(&csset->lock);
 		cs->is_dead = 1;
+		spin_unlock(&cs->lock);
 		pcs_cs_destroy(cs);
 		goto again;
 	}


More information about the Devel mailing list