Fill initid explicitly on requests.

Unfortunately ctl_scsi_zero_io() wipes that field, so it was always zero.
While there, targ_port is set by kernel, so user-space should not fill it.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2018-12-07 19:10:51 +00:00
parent b9de82a654
commit 9ce46e8107
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341704

View File

@ -389,7 +389,7 @@ pci_vtscsi_tmf_handle(struct pci_vtscsi_softc *sc,
ctl_scsi_zero_io(io);
io->io_hdr.io_type = CTL_IO_TASK;
io->io_hdr.nexus.targ_port = tmf->lun[1];
io->io_hdr.nexus.initid = sc->vss_iid;
io->io_hdr.nexus.targ_lun = pci_vtscsi_get_lun(tmf->lun);
io->taskio.tag_type = CTL_TAG_SIMPLE;
io->taskio.tag_num = (uint32_t)tmf->id;
@ -480,7 +480,7 @@ pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in,
io = ctl_scsi_alloc_io(sc->vss_iid);
ctl_scsi_zero_io(io);
io->io_hdr.nexus.targ_port = cmd_rd->lun[1];
io->io_hdr.nexus.initid = sc->vss_iid;
io->io_hdr.nexus.targ_lun = pci_vtscsi_get_lun(cmd_rd->lun);
io->io_hdr.io_type = CTL_IO_SCSI;