[Devel] [PATCH VZ9 10/20] fuse: use gratuitous notifications to allow reads from finished replicas

Alexey Kuznetsov kuznet at virtuozzo.com
Fri Oct 6 13:43:14 MSK 2023


Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
---
 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 59833eb..00489f5 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;
-- 
1.8.3.1



More information about the Devel mailing list