raid-migrate command fails on Little Endian machines if the stripe size
is not specified.  This happens because iprconfig will fallback to the
current stripe size of the RAID, loading it from the adapter without
doing proper endianness conversion.  This patch fixes the issue by
properly converting the data before using it.

Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
---
 iprconfig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iprconfig.c b/iprconfig.c
index fadf562..5152e4f 100644
--- a/iprconfig.c
+++ b/iprconfig.c
@@ -4570,9 +4570,9 @@ int do_raid_migrate(struct ipr_ioa *ioa, struct 
ipr_array_query_data *qac_data,
        } else
                /* get current stripe size */
                if (ioa->sis64)
-                       stripe_size = array_rcd->type3.stripe_size;
+                       stripe_size = ntohs(array_rcd->type3.stripe_size);
                else
-                       stripe_size = array_rcd->type2.stripe_size;
+                       stripe_size = ntohs(array_rcd->type2.stripe_size);
 
        /* if adding devices, check that there are a valid number of them */
        if (cap->format_overlay_type == IPR_FORMAT_ADD_DEVICES) {
-- 
2.1.0


------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to