Skip to content

Commit

Permalink
ibmvscsis: Use tpgt passed in by user
Browse files Browse the repository at this point in the history
ibmvscsis always returned 0 for the tpg/tag, since it did not
parse the value passed in by the user.

When functions like ALUA members exports the value, it will
be incorrect because targetcli/rtslib starts the tpg numbering
at 1.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Bryant G. Ly authored and Nicholas Bellinger committed Jul 7, 2017
1 parent 8fa4011 commit e9447a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,8 +3914,16 @@ static struct se_portal_group *ibmvscsis_make_tpg(struct se_wwn *wwn,
{
struct ibmvscsis_tport *tport =
container_of(wwn, struct ibmvscsis_tport, tport_wwn);
u16 tpgt;
int rc;

if (strstr(name, "tpgt_") != name)
return ERR_PTR(-EINVAL);
rc = kstrtou16(name + 5, 0, &tpgt);
if (rc)
return ERR_PTR(rc);
tport->tport_tpgt = tpgt;

tport->releasing = false;

rc = core_tpg_register(&tport->tport_wwn, &tport->se_tpg,
Expand Down

0 comments on commit e9447a4

Please sign in to comment.