Skip to content

Commit

Permalink
bsg: fix bogus EINVAL on non-data commands
Browse files Browse the repository at this point in the history
Fix a regression introduced in Linux kernel 4.17 where sending a SCSI
command that does not transfer data (such as TEST UNIT READY) via
/dev/bsg/* results in EINVAL.

Fixes: 17cb960 ("bsg: split handling of SCSI CDBs vs transport requeues")
Cc: <[email protected]> # 4.17+
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Tony Battersby <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
abattersby authored and axboe committed Jul 11, 2018
1 parent 9fea4b3 commit 70dbcc2
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode)
} else if (hdr->din_xfer_len) {
ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp),
hdr->din_xfer_len, GFP_KERNEL);
} else {
ret = blk_rq_map_user(q, rq, NULL, NULL, 0, GFP_KERNEL);
}

if (ret)
Expand Down

0 comments on commit 70dbcc2

Please sign in to comment.