From: Sabrina Dubroca <sd@queasysnail.net>
To: hch@lst.de
Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk,
Sabrina Dubroca <sd@queasysnail.net>
Subject: [PATCH] block: fix error handling in sg_io
Date: Tue, 26 Aug 2014 16:14:02 +0200 [thread overview]
Message-ID: <1409062442-32766-1-git-send-email-sd@queasysnail.net> (raw)
In-Reply-To: <20140826135143.GA30461@lst.de>
Before commit 2cada584b200 ("block: cleanup error handling in sg_io"),
we had ret = 0 before entering the last big if block of sg_io.
Since 2cada584b200, 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: 2cada584b200 ("block: cleanup error handling in sg_io")
---
block/scsi_ioctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 5dd477bfb4bc..9b8eaeca6a79 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -330,6 +330,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
if (blk_fill_sghdr_rq(q, rq, hdr, mode))
goto out_free_cdb;
+ ret = 0;
if (hdr->iovec_count) {
size_t iov_data_len;
struct iovec *iov = NULL;
--
2.1.0
next prev parent reply other threads:[~2014-08-26 14:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 13:31 linux-next: hdparm -B <value> broken Sabrina Dubroca
2014-08-26 13:51 ` Christoph Hellwig
2014-08-26 14:14 ` Sabrina Dubroca [this message]
2014-08-26 14:17 ` [PATCH] block: fix error handling in sg_io Jens Axboe
2014-08-26 14:18 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409062442-32766-1-git-send-email-sd@queasysnail.net \
--to=sd@queasysnail.net \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox