Commit c11599b8 authored by Jinshan Xiong's avatar Jinshan Xiong Committed by Greg Kroah-Hartman

staging/lustre/llite: clip page correctly for vvp_io_commit_sync

The original code was wrong which clipped page incorrectly for
partial pages started with zero.
Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/8531
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4201Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarwangdi <di.wang@intel.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71a96a05
...@@ -595,15 +595,17 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io, ...@@ -595,15 +595,17 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io,
if (plist->pl_nr == 0) if (plist->pl_nr == 0)
return 0; return 0;
if (from != 0) { if (from > 0 || to != PAGE_SIZE) {
page = cl_page_list_first(plist); page = cl_page_list_first(plist);
cl_page_clip(env, page, from, if (plist->pl_nr == 1) {
plist->pl_nr == 1 ? to : PAGE_SIZE); cl_page_clip(env, page, from, to);
} } else if (from > 0) {
if (to != PAGE_SIZE && plist->pl_nr > 1) { cl_page_clip(env, page, from, PAGE_SIZE);
} else {
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment