scsi: scsi_transport_sas: check reply payload length instead of bidi request
authorChristoph Hellwig <hch@lst.de>
Tue, 3 Oct 2017 10:48:41 +0000 (12:48 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 17 Oct 2017 03:40:51 +0000 (23:40 -0400)
As a user of bsg-lib the SAS transport should not poke into request
internals but use the bsg_job fields instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_sas.c

index 319dff9..736a1f4 100644 (file)
@@ -177,7 +177,7 @@ static int sas_smp_dispatch(struct bsg_job *job)
        if (!scsi_is_host_device(job->dev))
                rphy = dev_to_rphy(job->dev);
 
-       if (!job->req->next_rq) {
+       if (!job->reply_payload.payload_len) {
                dev_warn(job->dev, "space for a smp response is missing\n");
                bsg_job_done(job, -EINVAL, 0);
                return 0;