public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: hdparm -B <value> broken
@ 2014-08-26 13:31 Sabrina Dubroca
  2014-08-26 13:51 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Sabrina Dubroca @ 2014-08-26 13:31 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel, Jens Axboe


Hello,

Since next-20140823:

# hdparm -B 200 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0xc8 (200)
 HDIO_DRIVE_CMD failed: Bad address
 APM_level      = 128


It looks like before commit 2cada584b200 ("block: cleanup error
handling in sg_io"), we had ret = 0 before entering the last big if
block of sg_io, and now ret = -EFAULT.

The following patch seems to fix the problem:


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;



Thanks,

-- 
Sabrina

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-26 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH] block: fix error handling in sg_io Sabrina Dubroca
2014-08-26 14:17     ` Jens Axboe
2014-08-26 14:18     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox