[dm-devel] Make LUNs higher than 255 more friendly to look at

Brian Bunker brian at purestorage.com
Thu Sep 24 21:10:17 UTC 2020


For LUNs between 0 and 255 peripheral addressing is used. For LUNs higher than 255 the LUN addressing
should switch to flat according to the specification. Instead of printing out the LUN number without regard to
the shifting of address method, display the LUN as it was intended to be the user connecting the LUN. The
current display leaves a non-obvious 16384 offset.

In short, a LUN connected as 258 will show up in multipath output as 16642. Instead display it as the
expected 258. This is for display only and doesn’t change the actual contents of the LUN variable.

Signed-off-by: Brian Bunker <brian at purestorage.com>
___
--- a/libmultipath/print.c      2020-09-24 13:52:18.661828011 -0600
+++ b/libmultipath/print.c      2020-09-24 14:28:27.603542303 -0600
@@ -394,7 +394,7 @@
                        pp->sg_id.host_no,
                        pp->sg_id.channel,
                        pp->sg_id.scsi_id,
-                       pp->sg_id.lun);
+                       (pp->sg_id.lun & 0x4000) ? pp->sg_id.lun - 0x4000 : pp->sg_id.lun);
 }

 static int

Brian Bunker
SW Eng
brian at purestorage.com







More information about the dm-devel mailing list