When we are doing a partial IO on both first and last page,
the logic currently only call cl_page_clip on the first page, which
will end up with a incorrect i_size.
Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Reviewed-on: http://review.whamcloud.com/11630
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5552
Reviewed-by: Ian Costello <costello.ian@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
page = cl_page_list_first(plist);
if (plist->pl_nr == 1) {
cl_page_clip(env, page, from, to);
- } else if (from > 0) {
- cl_page_clip(env, page, from, PAGE_SIZE);
} else {
- page = cl_page_list_last(plist);
- cl_page_clip(env, page, 0, to);
- }
+ if (from > 0)
+ cl_page_clip(env, page, from, PAGE_SIZE);
+ if (to != PAGE_SIZE) {
+ page = cl_page_list_last(plist);
+ cl_page_clip(env, page, 0, to);
+ }
+ }
}
cl_2queue_init(queue);