]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
block: don't assume device has a request list backing in nr_requests store
authorJens Axboe <jens.axboe@oracle.com>
Fri, 11 Sep 2009 20:44:29 +0000 (22:44 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Sep 2009 15:43:57 +0000 (08:43 -0700)
commit b8a9ae779f2c7049071034661e09cb7e1e82250c upstream.

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.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
block/blk-sysfs.c

index d3aa2aadb3e0e7d18645a2eb9333698f4984263a..b78c9c3e26705f45fb1e90ac116dc8bb96c8122b 100644 (file)
@@ -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;