Older kernels on little endian systems had the device_id endian
swapped in sysfs. This has since been fixed up. This patch adds
support to iprinit to check for attributes saved using the old
endian swapped device id.

Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
---

 iprlib.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff -puN iprlib.c~iprutils_device_id_endian_swap iprlib.c
--- iprutils.patched/iprlib.c~iprutils_device_id_endian_swap    2016-10-25 
13:47:48.063256801 -0500
+++ iprutils.patched-bjking1/iprlib.c   2016-10-25 13:47:48.069256776 -0500
@@ -7214,6 +7214,15 @@ static int ipr_get_saved_dev_attr(struct
                        dev->scsi_dev_data->device_id);
 
                rc = ipr_get_saved_attr(dev->ioa, category, field, value);
+
+               if (rc) {
+                       /* Older kernels reported a byte swapped device_id, 
which has since
+                        been changed. Check both for compatibility reasons */
+                       sprintf(category,"[%s %lx]", IPR_CATEGORY_DEVICE,
+                               htobe64(dev->scsi_dev_data->device_id));
+
+                       rc = ipr_get_saved_attr(dev->ioa, category, field, 
value);
+               }
        }
 
        if (rc) {
_


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to