From 8fd8d4ad055b41ec89b5f81f9318a54ff9ffeed2 Mon Sep 17 00:00:00 2001 From: wang di Date: Wed, 8 Jul 2015 20:01:46 -0700 Subject: [PATCH] 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 --- lustre/lod/lod_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 1.8.3.1