scsi: ibmvscsis: Return correct partition name/# to client
authorMichael Cyr <mikecyr@us.ibm.com>
Thu, 13 Oct 2016 16:02:42 +0000 (11:02 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:54 +0000 (17:29 -0500)
Signed-off-by: Michael Cyr <mikecyr@us.ibm.com>
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

index cd9f5c734018193e4db8e68b0c1b54f8e2c60e7a..fe220a1450799bd343e04d4ed6424264ff41a47c 100644 (file)
@@ -3297,6 +3297,9 @@ static int ibmvscsis_probe(struct vio_dev *vdev,
        strncat(vscsi->eye, vdev->name, MAX_EYE);
 
        vscsi->dds.unit_id = vdev->unit_address;
+       strncpy(vscsi->dds.partition_name, partition_name,
+               sizeof(vscsi->dds.partition_name));
+       vscsi->dds.partition_num = partition_number;
 
        spin_lock_bh(&ibmvscsis_dev_lock);
        list_add_tail(&vscsi->list, &ibmvscsis_dev_list);
@@ -3495,7 +3498,7 @@ static int ibmvscsis_get_system_info(void)
 
        num = of_get_property(rootdn, "ibm,partition-no", NULL);
        if (num)
-               partition_number = *num;
+               partition_number = of_read_number(num, 1);
 
        of_node_put(rootdn);