From: Swapnil Pimpale Date: Wed, 7 Aug 2013 11:21:36 +0000 (+0530) Subject: LU-3162 lov: Get the correct address of lmm_objects X-Git-Tag: 2.4.91~20 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b3edbd0f5f9ef10941b98f2b82606916b850374a;hp=0a56d6db644b4009519429ba1b1463c7dd788167 LU-3162 lov: Get the correct address of lmm_objects The introduction of lmm_layout_gen makes the assumption that lmm_objects is present after lmm_stripe_count incorrect. Fixed this to get the correct address of lmm_objects when lmmk is cast to lov_mds_md_v1. Signed-off-by: Swapnil Pimpale Change-Id: I6eba151a54862fde60f4382df92864a52bb12530 Reviewed-on: http://review.whamcloud.com/7258 Tested-by: Hudson Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index c70f427..bc1e489 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -643,9 +643,8 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm, if (lum.lmm_magic == LOV_USER_MAGIC) { /* User request for v1, we need skip lmm_pool_name */ if (lmmk->lmm_magic == LOV_MAGIC_V3) { - memmove((char*)(&lmmk->lmm_stripe_count) + - sizeof(lmmk->lmm_stripe_count), - ((struct lov_mds_md_v3*)lmmk)->lmm_objects, + memmove(((struct lov_mds_md_v1 *)lmmk)->lmm_objects, + ((struct lov_mds_md_v3 *)lmmk)->lmm_objects, lmmk->lmm_stripe_count * sizeof(struct lov_ost_data_v1)); lmm_size -= LOV_MAXPOOLNAME;