Skip to content

Commit d19d744

Browse files
qsnaxboe
authored andcommitted
block: fix error handling in sg_io
Before commit 2cada58 ("block: cleanup error handling in sg_io"), we had ret = 0 before entering the last big if block of sg_io. Since 2cada58, ret = -EFAULT, which breaks hdparm: /dev/sda: setting Advanced Power Management level to 0xc8 (200) HDIO_DRIVE_CMD failed: Bad address APM_level = 128 Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Fixes: 2cada58 ("block: cleanup error handling in sg_io") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 2ba136d commit d19d744

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎block/scsi_ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
330330
if (blk_fill_sghdr_rq(q, rq, hdr, mode))
331331
goto out_free_cdb;
332332

333+
ret = 0;
333334
if (hdr->iovec_count) {
334335
size_t iov_data_len;
335336
struct iovec *iov = NULL;

0 commit comments

Comments
 (0)