summaryrefslogtreecommitdiffstats
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-09-11 22:44:29 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-09-14 08:24:53 +0200
commitb8a9ae779f2c7049071034661e09cb7e1e82250c (patch)
treee7063b668cc68f4337f1d6545e71d1f881d57e21 /block/blk-sysfs.c
parent3c5820c743479285ce2678fd3c12b1fd39fe998f (diff)
downloadlinux-stable-b8a9ae779f2c7049071034661e09cb7e1e82250c.tar.gz
linux-stable-b8a9ae779f2c7049071034661e09cb7e1e82250c.tar.bz2
linux-stable-b8a9ae779f2c7049071034661e09cb7e1e82250c.zip
block: don't assume device has a request list backing in nr_requests store
Stacked devices do not. For now, just error out with -EINVAL. Later we could make the limit apply on stacked devices too, for throttling reasons. This fixes 5a54cd13353bb3b88887604e2c980aa01e314309 and should go into 2.6.31 stable as well. Cc: stable@kernel.org Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index d3aa2aadb3e0..b78c9c3e2670 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -40,7 +40,12 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
{
struct request_list *rl = &q->rq;
unsigned long nr;
- int ret = queue_var_store(&nr, page, count);
+ int ret;
+
+ if (!q->request_fn)
+ return -EINVAL;
+
+ ret = queue_var_store(&nr, page, count);
if (nr < BLKDEV_MIN_RQ)
nr = BLKDEV_MIN_RQ;