Skip to content

Commit 70dbcc2

Browse files
abattersbyaxboe
authored andcommitted
bsg: fix bogus EINVAL on non-data commands
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]>
1 parent 9fea4b3 commit 70dbcc2

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

block/bsg.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode)
267267
} else if (hdr->din_xfer_len) {
268268
ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp),
269269
hdr->din_xfer_len, GFP_KERNEL);
270-
} else {
271-
ret = blk_rq_map_user(q, rq, NULL, NULL, 0, GFP_KERNEL);
272270
}
273271

274272
if (ret)

0 commit comments

Comments
 (0)