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

staging: lustre: lov: adjust page bufsize after layout change

Otherwise, the coh_page_bufsize keeps increasing when the file's
layout keeps changing in lov_init_raid0().
Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5459
Reviewed-on: http://review.whamcloud.com/11394Reviewed-by: default avatarfrank zago <fzago@cray.com>
Reviewed-by: default avatarBobi Jam <bobijam@gmail.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 97cba130
......@@ -195,6 +195,10 @@ static int lov_page_slice_fixup(struct lov_object *lov,
struct cl_object_header *hdr = cl_object_header(&lov->lo_cl);
struct cl_object *o;
if (!stripe)
return hdr->coh_page_bufsize - lov->lo_cl.co_slice_off -
cfs_size_round(sizeof(struct lov_page));
cl_object_for_each(o, stripe)
o->co_slice_off += hdr->coh_page_bufsize;
......@@ -720,6 +724,10 @@ static int lov_layout_change(const struct lu_env *unused,
LASSERT(atomic_read(&lov->lo_active_ios) == 0);
lov->lo_type = LLT_EMPTY;
/* page bufsize fixup */
cl_object_header(&lov->lo_cl)->coh_page_bufsize -=
lov_page_slice_fixup(lov, NULL);
result = new_ops->llo_init(env,
lu2lov_dev(lov->lo_cl.co_lu.lo_dev),
lov, conf, state);
......
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