Whamcloud - gitweb
LU-6834 lod: fix idx_array overwritten 72/15572/2
authorwang di <di.wang@intel.com>
Thu, 9 Jul 2015 03:01:46 +0000 (20:01 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 21 Jul 2015 15:54:00 +0000 (15:54 +0000)
Compare index with stripe_count -1 , otherwise it will
overwrite the idx_array[] in lod_prep_md_striped_create().

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ib116821fb9e9b800752d760c262ded725c55ce0e
Reviewed-on: http://review.whamcloud.com/15572
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_object.c

index 948a675..f191742 100644 (file)
@@ -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