Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: target: remove hardcoded T10 Vendor ID in INQUIRY response

Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but
can be reconfigured via the vendor_id ConfigFS attribute.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Bryant G. Ly <bly@catalogicsoftware.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

David Disseldorp and committed by
Martin K. Petersen
2d882847 54a6f3f6

+5 -3
+5 -3
drivers/target/target_core_spc.c
··· 115 115 */ 116 116 memset(&buf[8], 0x20, 117 117 INQUIRY_VENDOR_LEN + INQUIRY_MODEL_LEN + INQUIRY_REVISION_LEN); 118 - memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1); 118 + memcpy(&buf[8], dev->t10_wwn.vendor, 119 + strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN)); 119 120 memcpy(&buf[16], dev->t10_wwn.model, 120 121 strnlen(dev->t10_wwn.model, INQUIRY_MODEL_LEN)); 121 122 memcpy(&buf[32], dev->t10_wwn.revision, ··· 259 258 buf[off+1] = 0x1; /* T10 Vendor ID */ 260 259 buf[off+2] = 0x0; 261 260 /* left align Vendor ID and pad with spaces */ 262 - memset(&buf[off+4], 0x20, 8); 263 - memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1); 261 + memset(&buf[off+4], 0x20, INQUIRY_VENDOR_LEN); 262 + memcpy(&buf[off+4], dev->t10_wwn.vendor, 263 + strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN)); 264 264 /* Extra Byte for NULL Terminator */ 265 265 id_len++; 266 266 /* Identifier Length */