Whamcloud - gitweb
LU-4753 endianness: Fix cpu_to_leXX size mismatch 37/9637/2
authorSwapnil Pimpale <spimpale@ddn.com>
Thu, 13 Mar 2014 06:46:41 +0000 (12:16 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Mar 2014 07:18:21 +0000 (07:18 +0000)
In lod_prep_md_striped_create() and lod_xattr_set_lmv we use
cpu_to_le32() to transfer __u16 values. This patch replaces
cpu_to_le32() with cpu_to_le16().

Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Change-Id: Icc33e3fac711b63cc9d67fcec82dd1b4fdc10cce
Reviewed-on: http://review.whamcloud.com/9637
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/lod/lod_object.c

index b7e97ad..acdd4d0 100644 (file)
@@ -837,9 +837,9 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
                        memset(v3, 0, sizeof(*v3));
                        v3->lmm_magic = cpu_to_le32(LOV_USER_MAGIC_V3);
                        v3->lmm_stripe_count =
-                               cpu_to_le32(lo->ldo_def_stripenr);
+                               cpu_to_le16(lo->ldo_def_stripenr);
                        v3->lmm_stripe_offset =
-                               cpu_to_le32(lo->ldo_def_stripe_offset);
+                               cpu_to_le16(lo->ldo_def_stripe_offset);
                        v3->lmm_stripe_size =
                                cpu_to_le32(lo->ldo_def_stripe_size);
                        if (lo->ldo_pool)
@@ -1183,9 +1183,9 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt,
                        memset(v3, 0, sizeof(*v3));
                        v3->lmm_magic = cpu_to_le32(LOV_USER_MAGIC_V3);
                        v3->lmm_stripe_count =
-                               cpu_to_le32(lo->ldo_def_stripenr);
+                               cpu_to_le16(lo->ldo_def_stripenr);
                        v3->lmm_stripe_offset =
-                               cpu_to_le32(lo->ldo_def_stripe_offset);
+                               cpu_to_le16(lo->ldo_def_stripe_offset);
                        v3->lmm_stripe_size =
                                cpu_to_le32(lo->ldo_def_stripe_size);
                        if (lo->ldo_pool)