From 3a2743ed8f289e862390590e22707531aa6d0475 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Mon, 11 Dec 2023 18:15:44 -0500 Subject: [PATCH] EX-7601 ofd: minor debug improvements A smattering of minor debug improvements across several patches, placed at the end because they're all minor and some of them would disturb early parts of the series. Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I2071911eb09f5c7fad28203db05396bb31ccda59 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53418 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Artem Blagodarenko --- lustre/ofd/ofd_compress.c | 4 ++-- lustre/ofd/ofd_io.c | 15 ++++++++++----- lustre/target/tgt_handler.c | 9 +++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lustre/ofd/ofd_compress.c b/lustre/ofd/ofd_compress.c index 9eac26a..5124221 100644 --- a/lustre/ofd/ofd_compress.c +++ b/lustre/ofd/ofd_compress.c @@ -191,7 +191,7 @@ int decompress_rnb(const char *obd_name, struct niobuf_local *lnbs, CDEBUG(D_SEC, "leading chunk%s lnb %d lnb file offset %llu, chunk start %llu, chunk end %llu\n", - chunk_found ? "" : "not found", i, + chunk_found ? "" : " not found", i, lnb ? lnb->lnb_file_offset : 0, chunk_start, chunk_end); if (!chunk_found) @@ -231,7 +231,7 @@ int decompress_rnb(const char *obd_name, struct niobuf_local *lnbs, CDEBUG(D_SEC, "trailing chunk%s lnb %d lnb file offset %llu, chunk start %llu, chunk end %llu\n", - chunk_found ? "" : "not found", i, + chunk_found ? "" : " not found", i, lnb ? lnb->lnb_file_offset : 0, chunk_start, chunk_end); if (!chunk_found) diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index 2592248..157d2b0 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -646,8 +646,8 @@ static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp, orig_buf_start = buf_start; orig_buf_end = buf_end; - CDEBUG(D_SEC, "buf_start %llu, buf_end %llu\n", buf_start, - buf_end); + CDEBUG(D_SEC, "rnb %d buf_start %llu, buf_end %llu\n", + i, buf_start, buf_end); /* compressed reads must be rounded to cover whole chunks */ if (chunk_size) { @@ -665,12 +665,17 @@ static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp, * end of the previous one */ if (buf_start < prev_buf_end) { + CDEBUG(D_SEC, + "overlaps previous rounded read, start %llu < prev end %llu\n", + buf_start, prev_buf_end); buf_start = prev_buf_end; /* two rnbs may be entirely inside the same * chunk, in which case we're already doing IO * for that chunk, so skip it */ if (buf_start == buf_end) { + CDEBUG(D_SEC, + "read inside previous rounded read, skipping\n"); prev_buf_end = buf_end; continue; } @@ -875,8 +880,8 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp, orig_start = buf_start; orig_end = buf_end; - CDEBUG(D_SEC, "buf_start %llu, buf_end %llu\n", buf_start, - buf_end); + CDEBUG(D_SEC, "rnb %d buf_start %llu, buf_end %llu\n", i, + buf_start, buf_end); /* when writing to a compressed file, we have to round the write * to cover full chunks so we can read-modify-write full chunks @@ -1074,7 +1079,7 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp, LASSERT(chunk_size); CDEBUG(D_SEC, "read lnb %d at %llu\n", i, read_lnb[i].lnb_file_offset); for (; j < *nr_write; j++) { - CDEBUG(D_SEC, "write lnb %d at %llu\n", j, read_lnb[j].lnb_file_offset); + CDEBUG(D_SEC, "write lnb %d at %llu\n", j, write_lnb[j].lnb_file_offset); if (read_lnb[i].lnb_file_offset == write_lnb[j].lnb_file_offset) { CDEBUG(D_SEC, "read_lnb %d is write_lnb %d (offset %llu), lnb_rc %d\n", i, j, write_lnb[j].lnb_file_offset, read_lnb[i].lnb_rc); diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 1405c29..eb588df 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -2601,6 +2601,10 @@ int tgt_brw_read(struct tgt_session_info *tsi) nob += page_rc; if (page_rc != 0 && desc != NULL) { /* some data! */ LASSERT(local_tx_nb[i].lnb_page != NULL); + CDEBUG(D_SEC, + "adding frag, page %d, at offset %llu, len %d\n", + i, local_tx_nb[i].lnb_file_offset, + local_tx_nb[i].lnb_len); desc->bd_frag_ops->add_kiov_frag (desc, local_tx_nb[i].lnb_page, local_tx_nb[i].lnb_page_offset & ~PAGE_MASK, @@ -3073,8 +3077,9 @@ int tgt_brw_write(struct tgt_session_info *tsi) /* NB Having prepped, we must commit... */ for (i = 0; i < npages_remote; i++) { - CDEBUG(D_SEC, "adding frag, page %d, offset %lu, len %d\n", - i, local_tx_nb[i].lnb_page_offset & ~PAGE_MASK, + CDEBUG(D_SEC, + "adding frag, page %d, at offset %llu, len %d\n", + i, local_tx_nb[i].lnb_file_offset, local_tx_nb[i].lnb_len); desc->bd_frag_ops->add_kiov_frag(desc, local_tx_nb[i].lnb_page, -- 1.8.3.1