mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
block: fix bogus EFAULT error from SG_IO ioctl
Whenever blk_fill_sghdr_rq fails, its errno code is ignored and changed to EFAULT. This can cause very confusing errors: $ sg_persist -k /dev/sda persistent reservation in: pass through os error: Bad address The fix is trivial, just propagate the return value from blk_fill_sghdr_rq. Signed-off-by: Paolo Bonzini <[email protected]> Acked-by: Jeff Moyer <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
3399a3f746
commit
2c4cffe851
1 changed files with 2 additions and 2 deletions
|
|
@ -326,8 +326,8 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
|
|||
goto out_put_request;
|
||||
}
|
||||
|
||||
ret = -EFAULT;
|
||||
if (blk_fill_sghdr_rq(q, rq, hdr, mode))
|
||||
ret = blk_fill_sghdr_rq(q, rq, hdr, mode);
|
||||
if (ret < 0)
|
||||
goto out_free_cdb;
|
||||
|
||||
ret = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue