From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757319AbcDEBoh (ORCPT ); Mon, 4 Apr 2016 21:44:37 -0400 Received: from smtp2.ccs.ornl.gov ([160.91.199.39]:46811 "EHLO smtp2.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932768AbcDEBl4 (ORCPT ); Mon, 4 Apr 2016 21:41:56 -0400 From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin Cc: Linux Kernel Mailing List , Lustre Development List , Swapnil Pimpale , James Simmons Subject: [PATCH 09/18] staging: lustre: lov: Get the correct address of lmm_objects Date: Mon, 4 Apr 2016 21:36:54 -0400 Message-Id: <1459820223-24754-10-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1459820223-24754-1-git-send-email-jsimmons@infradead.org> References: <1459820223-24754-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Swapnil Pimpale 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3162 Reviewed-on: http://review.whamcloud.com/7258 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/lov_pack.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 3925633..2f02be5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -444,8 +444,7 @@ 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), + 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)); -- 1.7.1