From: wang di Date: Thu, 9 Jul 2015 03:01:46 +0000 (-0700) Subject: LU-6834 lod: fix idx_array overwritten X-Git-Tag: 2.7.57~24 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F15572%2F2;p=fs%2Flustre-release.git LU-6834 lod: fix idx_array overwritten Compare index with stripe_count -1 , otherwise it will overwrite the idx_array[] in lod_prep_md_striped_create(). Signed-off-by: wang di Change-Id: Ib116821fb9e9b800752d760c262ded725c55ce0e Reviewed-on: http://review.whamcloud.com/15572 Tested-by: Jenkins Reviewed-by: Niu Yawei Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 948a675..f191742 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -1893,7 +1893,7 @@ static int lod_prep_md_striped_create(const struct lu_env *env, idx, i, PFID(&fid)); idx_array[i] = idx; /* Set the start index for next stripe allocation */ - if (i < stripe_count) + if (i < stripe_count - 1) idx_array[i + 1] = (idx + 1) % (lod->lod_remote_mdt_count + 1); /* tgt_dt and fid must be ready after search avaible OSP