Linux Kernels

staging: lustre: lov: Get the correct address of lmm_objects

This change “staging: lustre: lov: Get the correct address of lmm_objects” (commit 98b2982) in Linux kernel is authored by Swapnil Pimpale <spimpale [at] ddn.com> on Mon Apr 4 21:36:54 2016 -0400.

Description of "staging: lustre: lov: Get the correct address of lmm_objects"

The change “staging: lustre: lov: Get the correct address of lmm_objects” introduces changes as follows.

staging: lustre: 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 <spimpale@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3162
Reviewed-on: http://review.whamcloud.com/7258
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 98b2982

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: lustre: lov: Get the correct address of lmm_objects"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/lustre/lustre/lov/lov_pack.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 
diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c
index 9723d2e091b1..d983a30b1e3a 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));

The commit for this change in Linux stable tree is 98b2982 (patch).

Last modified: 2020/01/11 10:04