Whamcloud - gitweb
LU-13004 osp: use correct page count in osp_prep_update_req 87/37587/3
authorMr NeilBrown <neilb@suse.de>
Thu, 21 Nov 2019 03:53:59 +0000 (14:53 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:51:24 +0000 (05:51 +0000)
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 <neilb@suse.de>
Change-Id: Ic8dcdac414d16b4f2c1c6e0367d496de7e0a8cff
Reviewed-on: https://review.whamcloud.com/37587
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_trans.c

index 9686863..aa5ba5d 100644 (file)
@@ -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;