Skip to contentSkip to conversation

libmultipath: Increase SERIAL_SIZE to 256 bytes

PATCH In review KyleMahlkuch 2 participants 3 messages Aug 28, 2018 – Dec 11, 2018 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: Increase SERIAL_SIZE to 256 bytes

Certain IBM FlashSystem LUNs can return up to 85 bytes of serial number in the Unit Serial Number VPD page, which is larger than the current SERIAL_SIZE definition of 65 bytes. Since the max size of this field does not appear to be defined in SPC, increasing to 256 bytes should hopefully prevent us from hitting this in future.

This is an example of a serial number from a FlashSystem:
Unit serial number VPD page:
Unit serial number: 3321360050764008101AB300000000000012204214503IBMfcp

Before this patch multipath returns the error:

Jul 17 11:24:58 | vpd pg80 overflow, 85/65 bytes required

After the patch is applied the error no longer occur.

---
 libmultipath/structs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/structs.h +1 -1
index bfa660a..00a1b1a 100644
@@ -8,7 +8,7 @@
 #include "byteorder.h"
 
 #define WWID_SIZE		128
-#define SERIAL_SIZE		65
+#define SERIAL_SIZE		256
 #define NODE_NAME_SIZE		224
 #define PATH_STR_SIZE		16
 #define PARAMS_SIZE		4096
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · KyleMahlkuch

Certain IBM FlashSystem LUNs can return up to 85 bytes of serial number in the Unit Serial Number VPD page, which is larger than the current SERIAL_SIZE definition of 65 bytes. Since the max size of this field does not appear to be defined in SPC, increasing to 256 bytes should hopefully prevent us from hitting this in future.

I'm not against it, but would 128 be enough, too? That's what we use for WWID.

Quoted 4 lines

This is an example of a serial number from a FlashSystem:
Unit serial number VPD page:
Unit serial number:
3321360050764008101AB300000000000012204214503IBMfcp

$ echo 3321360050764008101AB300000000000012204214503IBMfcp | wc -c
52

It looks as if 65 bytes would be sufficient for _this_ serial number. Is there excessive space padding at the end, maybe? Run

sg_vpd -p sn -r $DEV | hexdump -C

Quoted 10 lines

Before this patch multipath returns the error:

Jul 17 11:24:58 | vpd pg80 overflow, 85/65 bytes required

After the patch is applied the error no longer occur.

---
 libmultipath/structs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Martin

Signature · 9 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
#2 lore raw
In reply to KyleMahlkuch

Kyle,

please resubmit with SERIAL_SIZE=128. That should be sufficient for the time being.

Martin

Quoted 35 lines · KyleMahlkuch

Certain IBM FlashSystem LUNs can return up to 85 bytes of serial number in the Unit Serial Number VPD page, which is larger than the current SERIAL_SIZE definition of 65 bytes. Since the max size of this field does not appear to be defined in SPC, increasing to 256 bytes should hopefully prevent us from hitting this in future.

This is an example of a serial number from a FlashSystem:
Unit serial number VPD page:
Unit serial number:
3321360050764008101AB300000000000012204214503IBMfcp

Before this patch multipath returns the error:

Jul 17 11:24:58 | vpd pg80 overflow, 85/65 bytes required

After the patch is applied the error no longer occur.

---
 libmultipath/structs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/structs.h +1 -1
index bfa660a..00a1b1a 100644
@@ -8,7 +8,7 @@
 #include "byteorder.h"
 
 #define WWID_SIZE		128
-#define SERIAL_SIZE		65
+#define SERIAL_SIZE		256
 #define NODE_NAME_SIZE		224
 #define PATH_STR_SIZE		16
 #define PARAMS_SIZE		4096
Signature · 9 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel