From: Mr NeilBrown Date: Thu, 21 Nov 2019 03:53:59 +0000 (+1100) Subject: LU-13004 osp: use correct page count in osp_prep_update_req X-Git-Tag: 2.13.53~194 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F37587%2F3;p=fs%2Flustre-release.git LU-13004 osp: use correct page count in osp_prep_update_req A fix that went into patchset 3 of https://review.whamcloud.com/#/c/36828/3 disappeared in patchset 5. We should restore it. Specifically, 'page_count' should be a count of pages, but it is currently a count of the bytes in all the pages. Fixes: f32fbf189fab ("LU-13004 osp: use KIOV in osp_prep_update_req") Signed-off-by: Mr NeilBrown Change-Id: Ic8dcdac414d16b4f2c1c6e0367d496de7e0a8cff Reviewed-on: https://review.whamcloud.com/37587 Tested-by: jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/osp/osp_trans.c b/lustre/osp/osp_trans.c index 9686863..aa5ba5d 100644 --- a/lustre/osp/osp_trans.c +++ b/lustre/osp/osp_trans.c @@ -419,7 +419,8 @@ int osp_prep_update_req(const struct lu_env *env, struct obd_import *imp, list_for_each_entry(ours, &our->our_req_list, ours_list) { oub->oub_size = ours->ours_req_size; oub++; - page_count += round_up(ours->ours_req_size, PAGE_SIZE) + 1; + /* First *and* last might be partial pages, hence +1 */ + page_count += DIV_ROUND_UP(ours->ours_req_size, PAGE_SIZE) + 1; } req->rq_bulk_write = 1;