[Devel] [PATCH RHEL9 COMMIT] fs/fuse kio: skip handling dropped cslists in pcs_map_notify_addr_change

Konstantin Khorenko khorenko at virtuozzo.com
Fri Dec 15 20:59:26 MSK 2023


The commit is pushed to "branch-rh9-5.14.0-362.8.1.vz9.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-362.8.1.vz9.35.2
------>
commit 063c30f17ff18889367dac2daf8ceea1f4d89218
Author: Yuriy Vasilev <yuriy.vasilev at virtuozzo.com>
Date:   Wed Nov 29 11:12:55 2023 +0100

    fs/fuse kio: skip handling dropped cslists in pcs_map_notify_addr_change
    
    If try_cslist_get returns false, it indicates that the cslist has been
    dropped and should not be handled without holding cs->lock.
    
    https://pmc.acronis.work/browse/VSTOR-76384
    
    Signed-off-by: Yuriy Vasilev <yuriy.vasilev at virtuozzo.com>
    Acked-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_map.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index eabad8a9c1fe..424d36d26986 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -766,8 +766,11 @@ void pcs_map_notify_addr_change(struct pcs_cs * cs)
 		 * Thus, csl stays on the place in the list. New elements may be
 		 * added to head of cs->map_list, so our caller must care, they
 		 * will contain correct rpc addr.
+		 * If false is returned, it indicates that the cslist has been dropped
+		 * and should not be handled here.
 		 */
-		cslist_get(cs_list);
+		if (!try_cslist_get(cs_list))
+			continue;
 		spin_unlock(&cs->lock);
 
 		if (prev_cs_list)


More information about the Devel mailing list