[Devel] [PATCH VZ7 3/4] fs/fuse kio: skip handling dropped cslists in pcs_map_notify_addr_change

Yuriy Vasilev yuriy.vasilev at virtuozzo.com
Fri Dec 15 18:33:53 MSK 2023


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>
---
 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 1ce07b0fd28f..8c91b394c50f 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -777,8 +777,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)
-- 
2.34.1



More information about the Devel mailing list