From: Niu Yawei Date: Sun, 18 Sep 2016 20:37:12 +0000 (-0400) Subject: staging: lustre: osc: update kms in brw_interpret() properly X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=60deafeae486f8e6b1b4cc781214521e615c9459;p=linux-beck.git staging: lustre: osc: update kms in brw_interpret() properly In brw_interpret(), we forgot page offset when calculating write offset, that leads to wrong kms for sync write. Signed-off-by: Niu Yawei Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5463 Reviewed-on: http://review.whamcloud.com/11374 Reviewed-by: Bobi Jam Reviewed-by: Jinshan Xiong Reviewed-by: Li Dongyang Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index e861973639f8..e44b4fac4212 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -1796,7 +1796,8 @@ static int brw_interpret(const struct lu_env *env, if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE) { struct lov_oinfo *loi = cl2osc(obj)->oo_oinfo; - loff_t last_off = last->oap_count + last->oap_obj_off; + loff_t last_off = last->oap_count + last->oap_obj_off + + last->oap_page_off; /* Change file size if this is an out of quota or * direct IO write and it extends the file size