[Devel] [PATCH RHEL9 COMMIT] fuse: use gratuitous notifications to allow reads from finished replicas

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 1 22:46:02 MSK 2023


The commit is pushed to "branch-rh9-5.14.0-284.25.1.vz9.30.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-284.25.1.vz9.30.8
------>
commit 19358af22afdc8b2b75632e7a24284200f5a2e05
Author: Alexey Kuznetsov <kuznet at virtuozzo.com>
Date:   Fri Oct 6 18:43:14 2023 +0800

    fuse: use gratuitous notifications to allow reads from finished replicas
    
    https://pmc.acronis.work/browse/VSTOR-54040
    
    Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
    
    Feature: vStorage
---
 fs/fuse/kio/pcs/pcs_map.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index 59833ebc1db7..00489f50bf09 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -2838,11 +2838,14 @@ static int commit_sync_info(struct pcs_int_request *req,
 		    (h->hdr.type == PCS_CS_WRITE_RESP || h->hdr.type == PCS_CS_WRITE_AL_RESP))
 			clear_bit(CSL_SF_HAS_REPLICATING, &csl->state_flags);
 	} else {
+		int read_idx = req->iochunk.cs_index;
+
 		/* In case we did successful read on would-be replicating CS resync the state */
 		if (test_bit(CSL_SF_HAS_REPLICATING, &csl->state_flags) &&
-		    test_bit(CS_SF_REPLICATING, &csl->cs[req->iochunk.cs_index].cslink.cs->state)) {
+		    test_bit(CS_SF_REPLICATING, &csl->cs[read_idx].cslink.cs->state)) {
 			int idx;
-			clear_bit(CS_SF_REPLICATING, &csl->cs[req->iochunk.cs_index].cslink.cs->state);
+			clear_bit(CS_SF_REPLICATING, &csl->cs[read_idx].cslink.cs->state);
+			clear_bit(read_idx, &csl->blacklist);
 			for (idx = csl->nsrv - 1; idx >= 0; idx++) {
 				if (test_bit(CS_SF_REPLICATING, &csl->cs[idx].cslink.cs->state))
 					break;


More information about the Devel mailing list