From 5f04a9d6d6a4709382f8981c8cc56d526cefa2dc Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Thu, 21 Nov 2019 14:53:59 +1100 Subject: [PATCH] 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 --- lustre/osp/osp_trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 1.8.3.1