Skip to content

Commit

Permalink
block: don't assume device has a request list backing in nr_requests …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Jens Axboe committed Sep 14, 2009
1 parent 3c5820c commit b8a9ae7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b8a9ae7

Please sign in to comment.