From: Patrick Farrell Date: Thu, 16 Nov 2023 23:26:26 +0000 (-0500) Subject: EX-7601 osc: allow multiple chunks in read X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=0445d361b2a4e535f3a06ab2bdd185104b6a5a14;p=fs%2Flustre-release.git EX-7601 osc: allow multiple chunks in read It's rare, but reads can sometimes have multiple discontiguous chunks. Update decompress_request to handle this case. Signed-off-by: Patrick Farrell Change-Id: I880af95db285dce76db3610e8140a0f54baa401b Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53159 Tested-by: jenkins Tested-by: Andreas Dilger Reviewed-by: Artem Blagodarenko Reviewed-by: Andreas Dilger --- diff --git a/lustre/osc/osc_compress.c b/lustre/osc/osc_compress.c index ebe1487..6a921df 100644 --- a/lustre/osc/osc_compress.c +++ b/lustre/osc/osc_compress.c @@ -245,11 +245,11 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count) unsigned int src_size; unsigned int dst_size; int pages_per_chunk; - int pages_left; char *src = NULL; char *dst = NULL; int chunk_bits; int chunk_size; + int pages_left; int count = 0; int buf_bits; int rc = 0; @@ -271,29 +271,18 @@ int decompress_request(struct osc_brw_async_args *aa, int page_count) rc = alloc_compr(obd_name, &type, lvl, &cc, true); if (rc) GOTO(out, rc); - /* the RPC may not start on a chunk boundary, find the first chunk - * boundary, then start iterating by chunk_size at that point (in the - * next loop) - */ + for (i = 0; i < page_count; i++) { oap = brw_page2oap(pga[i]); + CDEBUG(D_SEC, "checking page %d, offset %llu\n", + i, oap->oap_obj_off); - /* aligned to chunk size */ - if (!(oap->oap_obj_off & (chunk_size - 1))) - break; - } - - /* no chunk aligned pages in the RPC, no possibility of a compressed - * chunk - */ - if (i == page_count) - GOTO(out, rc = 0); - - CDEBUG(D_SEC, "starting decompression at page %d, offset %llu\n", - i, oap->oap_obj_off); + /* not aligned to chunk size, so can't be the start of a + * compressed chunk - continue + */ + if (oap->oap_obj_off & (chunk_size - 1)) + continue; - /* i is the first chunk aligned page in the RPC */ - for (; i < page_count; i+=pages_per_chunk) { if (!is_chunk_start(pga[i]->pg, &llch)) continue;