diff options
author | Bryant G. Ly <bryantly@linux.vnet.ibm.com> | 2017-06-06 23:45:49 +0300 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-07-07 09:11:28 +0300 |
commit | e9447a46e9fba006ff9b0f4e40a4e38bf2d788db (patch) | |
tree | 48a3082e20a6ce4873071110a71dc027953ec486 /drivers | |
parent | 8fa4011e0dd9423f1226f2f9769a1cf25c264468 (diff) | |
download | linux-e9447a46e9fba006ff9b0f4e40a4e38bf2d788db.tar.xz |
ibmvscsis: Use tpgt passed in by user
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index 35710524d059..522d547d9fea 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -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, |