提交 902a34ad 编写于 作者: L Li Dongyang 提交者: Greg Kroah-Hartman

staging/lustre/llite: make sure we do cl_page_clip on the last page

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: NLi Dongyang <dongyang.li@anu.edu.au>
Reviewed-on: http://review.whamcloud.com/11630
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5552Reviewed-by: NIan Costello <costello.ian@gmail.com>
Reviewed-by: NNiu Yawei <yawei.niu@intel.com>
Reviewed-by: NLi Xi <pkuelelixi@gmail.com>
Reviewed-by: NJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: NOleg Drokin <green@linuxhacker.ru>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d37dd10b
...@@ -599,13 +599,15 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io, ...@@ -599,13 +599,15 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io,
page = cl_page_list_first(plist); page = cl_page_list_first(plist);
if (plist->pl_nr == 1) { if (plist->pl_nr == 1) {
cl_page_clip(env, page, from, to); cl_page_clip(env, page, from, to);
} else if (from > 0) {
cl_page_clip(env, page, from, PAGE_SIZE);
} else { } else {
if (from > 0)
cl_page_clip(env, page, from, PAGE_SIZE);
if (to != PAGE_SIZE) {
page = cl_page_list_last(plist); page = cl_page_list_last(plist);
cl_page_clip(env, page, 0, to); cl_page_clip(env, page, 0, to);
} }
} }
}
cl_2queue_init(queue); cl_2queue_init(queue);
cl_page_list_splice(plist, &queue->c2_qin); cl_page_list_splice(plist, &queue->c2_qin);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册