]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: target: remove hardcoded T10 Vendor ID in INQUIRY response
authorAlan Adamson <alan.adamson@oracle.com>
Fri, 8 Mar 2019 17:52:01 +0000 (09:52 -0800)
committerBrian Maly <brian.maly@oracle.com>
Tue, 9 Apr 2019 22:22:32 +0000 (18:22 -0400)
Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG",
but can be reconfigured via the vendor_id ConfigFS attribute.

This commit was backported by hand.

Orabug: 29344862

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
Reviewed-by: Bijan Mottahedeh <bijan.mottahedeh@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/target/target_core_spc.c

index 313145294dfd73a8d9c6cd3db90dea2ef66135be..c51a192d02d880d8a7fd0c3841665c5856ec8da9 100644 (file)
@@ -122,7 +122,8 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
         */
        memset(&buf[8], 0x20,
                INQUIRY_VENDOR_LEN + INQUIRY_MODEL_LEN + INQUIRY_REVISION_LEN);
-       memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1);
+       memcpy(&buf[8], dev->t10_wwn.vendor,
+               strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN));
        memcpy(&buf[16], dev->t10_wwn.model,
                strnlen(dev->t10_wwn.model, INQUIRY_MODEL_LEN));
        memcpy(&buf[32], dev->t10_wwn.revision,
@@ -275,8 +276,9 @@ check_t10_vend_desc:
        buf[off+1] = 0x1; /* T10 Vendor ID */
        buf[off+2] = 0x0;
        /* left align Vendor ID and pad with spaces */
-       memset(&buf[off+4], 0x20, 8);
-       memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1);
+       memset(&buf[off+4], 0x20, INQUIRY_VENDOR_LEN);
+       memcpy(&buf[off+4], dev->t10_wwn.vendor,
+               strnlen(dev->t10_wwn.vendor, INQUIRY_VENDOR_LEN));
        /* Extra Byte for NULL Terminator */
        id_len++;
        /* Identifier Length */