From: Jinshan Xiong Date: Tue, 5 Aug 2014 23:42:45 +0000 (-0700) Subject: LU-5459 lov: adjust page bufsize after layout change X-Git-Tag: 2.6.52~54 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=df9bfaf3b48124e201cbea845b0aac5a8aad8b7d;p=fs%2Flustre-release.git LU-5459 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: Jinshan Xiong Change-Id: I70066b916d72aabe0349a1faec65eff160e9cf04 Reviewed-on: http://review.whamcloud.com/11394 Reviewed-by: frank zago Tested-by: Jenkins Reviewed-by: Bobi Jam Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index 7d5c325..19a9bcf 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -198,6 +198,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 == NULL) + 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; @@ -730,6 +734,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);