[lvm-devel] main - device_id: handle scsi_debug wwid

David Teigland teigland at sourceware.org
Tue Jun 22 18:38:08 UTC 2021


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1139a05939f85bd86a756b451a8f194bc7a72a2c
Commit:        1139a05939f85bd86a756b451a8f194bc7a72a2c
Parent:        c35f7722d588009edad22d59c68c82150bb5c216
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Tue Jun 22 13:36:10 2021 -0500
Committer:     David Teigland <teigland at redhat.com>
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(+)

diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 65912b9b6..ffeac3064 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -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)




More information about the lvm-devel mailing list