Skip to contentSkip to conversation

main - device_id: handle scsi_debug wwid

PATCH David Teigland 1 participant 1 message Jun 22, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1139a05939f85bd86a756b451a8f194bc7a72a2c
Commit:        1139a05939f85bd86a756b451a8f194bc7a72a2c
Parent:        c35f7722d588009edad22d59c68c82150bb5c216
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Jun 22 13:36:10 2021 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Jun 22 13:36:10 2021 -0500

device_id: handle scsi_debug wwid

Ignore the wwid value reported by scsi_debug devices
that begin "t10.Linux scsi_debug". The devname
will be used as the device id.

---
 lib/device/device_id.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/device/device_id.c +4 -0
index 65912b9b6..ffeac3064 100644
@@ -308,6 +308,10 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
 
 		if (!sysbuf[0])
 			_read_sys_block(cmd, dev, "wwid", sysbuf, sizeof(sysbuf));
+
+		/* scsi_debug wwid begins "t10.Linux   scsi_debug ..." */
+		if (strstr(sysbuf, "scsi_debug"))
+			sysbuf[0] = '\0';
 	}
 
 	else if (idtype == DEV_ID_TYPE_SYS_SERIAL)