Jason Yan
621f6401fd
scsi: libsas: fix length error in sas_smp_handler()
...
The return value of smp_execute_task_sg() is the untransferred residual,
but bsg_job_done() requires the length of payload received. This makes
SMP passthrough commands from userland by sg ioctl to libsas get a wrong
response. The userland tools such as smp_utils failed because of these
wrong responses:
~#smp_discover /dev/bsg/expander-2\:13
response too short, len=0
~#smp_discover /dev/bsg/expander-2\:134
response too short, len=0
Fix this by passing the actual received length to bsg_job_done(). And if
smp_execute_task_sg() returns 0, this means received length is exactly
the buffer length.
[mkp: typo]
Fixes: 651a013649 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough")
Cc: <stable@vger.kernel.org > # v4.14+
Signed-off-by: Jason Yan <yanaijie@huawei.com >
Reported-by: chenqilin <chenqilin2@huawei.com >
Tested-by: chenqilin <chenqilin2@huawei.com >
CC: Christoph Hellwig <hch@lst.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-12-11 21:45:34 -05:00
..
2017-11-02 11:10:55 +01:00
2017-11-15 13:46:33 -08:00
2017-11-14 16:54:12 -08:00
2017-11-15 13:46:33 -08:00
2017-11-15 14:11:41 -08:00
2017-11-15 11:56:19 -08:00
2017-11-13 17:56:58 -08:00
2017-11-14 18:25:40 -08:00
2017-11-15 11:56:19 -08:00
2017-11-14 16:54:12 -08:00
2017-11-04 09:26:51 +09:00
2017-11-15 10:56:56 -08:00
2017-11-14 15:32:19 -08:00
2017-11-15 15:12:28 -08:00
2017-11-03 13:56:15 -07:00
2017-11-15 10:56:56 -08:00
2017-10-22 02:22:39 +01:00
2017-11-13 19:43:50 -08:00
2017-11-13 01:34:14 +01:00
2017-11-14 10:52:09 -08:00
2017-11-02 11:10:55 +01:00
2017-11-13 01:41:39 +01:00
2017-11-02 11:10:55 +01:00
2017-11-14 16:49:31 -08:00
2017-11-02 11:10:55 +01:00
2017-11-15 13:46:33 -08:00
2017-11-02 11:10:55 +01:00
2017-11-13 21:14:07 -08:00
2017-11-13 17:56:58 -08:00
2017-11-07 10:32:44 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-14 17:52:21 -08:00
2017-11-14 18:25:40 -08:00
2017-11-15 13:46:33 -08:00
2017-11-15 13:35:43 -08:00
2017-11-10 10:03:12 +01:00
2017-11-13 08:55:46 -08:00
2017-11-02 11:10:55 +01:00
2017-11-14 14:44:04 -08:00
2017-11-14 17:52:21 -08:00
2017-11-15 13:46:33 -08:00
2017-11-13 01:34:14 +01:00
2017-11-14 14:44:04 -08:00
2017-11-15 14:54:53 -08:00
2017-11-14 18:07:18 -08:00
2017-11-14 16:43:27 -08:00
2017-11-15 15:01:28 -08:00
2017-11-15 13:46:33 -08:00
2017-11-14 18:09:31 -08:00
2017-11-14 15:32:19 -08:00
2017-11-13 17:56:58 -08:00
2017-11-15 13:39:18 -08:00
2017-11-02 11:10:55 +01:00
2017-11-15 13:46:33 -08:00
2017-11-15 13:46:33 -08:00
2017-11-02 11:10:55 +01:00
2017-11-13 17:56:58 -08:00
2017-11-15 13:46:33 -08:00
2017-11-14 18:01:46 -08:00
2017-11-15 15:01:28 -08:00
2017-11-13 10:17:35 -08:00
2017-11-15 13:46:33 -08:00
2017-11-15 14:54:53 -08:00
2017-11-15 11:56:19 -08:00
2017-11-13 12:10:24 -08:00
2017-11-15 10:14:11 -08:00
2017-11-14 15:32:19 -08:00
2017-11-02 11:10:55 +01:00
2017-11-15 15:01:28 -08:00
2017-10-14 00:54:41 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-13 17:56:58 -08:00
2017-11-15 15:01:28 -08:00
2017-11-15 15:01:28 -08:00
2017-11-15 10:56:56 -08:00
2017-11-13 21:14:07 -08:00
2017-11-14 17:23:44 -08:00
2017-11-15 13:46:33 -08:00
2017-11-02 11:10:55 +01:00
2017-11-15 13:37:15 -08:00
2017-09-08 18:26:51 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-13 17:56:58 -08:00
2017-11-13 10:17:35 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-13 17:56:58 -08:00
2017-11-15 11:56:19 -08:00
2017-11-02 11:10:55 +01:00
2017-12-11 21:45:34 -05:00
2017-11-14 16:54:12 -08:00
2017-11-13 21:14:07 -08:00
2017-11-10 21:33:51 +00:00
2017-11-02 11:10:55 +01:00
2017-11-15 14:54:53 -08:00
2017-11-14 14:44:04 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-04 09:26:51 +09:00
2017-11-15 13:46:33 -08:00
2017-11-02 11:10:55 +01:00
2017-11-14 18:01:46 -08:00
2017-11-02 11:10:55 +01:00
2017-11-14 16:47:47 -08:00
2017-11-15 11:56:19 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-15 11:36:08 -08:00
2017-11-13 17:56:58 -08:00
2017-11-02 11:10:55 +01:00
2017-11-13 01:40:52 +01:00
2017-11-13 01:40:52 +01:00