From 6d1045d63a5bf33a1f26e0fd939305bdd49767f3 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 14 Feb 2023 13:24:15 -0500 Subject: [PATCH] LU-13805 osc: Add debug This adds some minor additional debug for unaligned IO. The purpose here is just to shorten the length of the main patch by pulling out supporting bits. Signed-off-by: Patrick Farrell Change-Id: Ia1e749788b66f1d6d3440eb99ff3e86c893fd3f3 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49988 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Sebastien Buisson --- lustre/osc/osc_page.c | 2 ++ lustre/osc/osc_request.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 8be11a2..6e491d5 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -204,6 +204,8 @@ static void osc_page_clip(const struct lu_env *env, struct osc_page *opg = cl2osc_page(slice); struct osc_async_page *oap = &opg->ops_oap; + CDEBUG(D_CACHE, "from %d, to %d\n", from, to); + opg->ops_from = from; /* argument @to is exclusive, but @ops_to is inclusive */ opg->ops_to = to - 1; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index ad3c4c6..c351d67 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2719,16 +2719,20 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, list_add_tail(&oap->oap_rpc_item, &rpc_list); if (starting_offset == OBD_OBJECT_EOF || - starting_offset > oap->oap_obj_off) + starting_offset > oap->oap_obj_off) { starting_offset = oap->oap_obj_off; - else + } else { + CDEBUG(D_CACHE, "page i:%d, oap->oap_obj_off %llu, oap->oap_page_off %u\n", + i, oap->oap_obj_off, oap->oap_page_off); LASSERT(oap->oap_page_off == 0); - if (ending_offset < oap->oap_obj_off + oap->oap_count) + } + if (ending_offset < oap->oap_obj_off + oap->oap_count) { ending_offset = oap->oap_obj_off + oap->oap_count; - else + } else { LASSERT(oap->oap_page_off + oap->oap_count == PAGE_SIZE); + } } if (ext->oe_ndelay) ndelay = true; -- 1.8.3.1