]> Git Repo - linux.git/commitdiff
bsg: fix bsg_poll() to return POLLOUT properly
authorNamhyung Kim <[email protected]>
Mon, 20 Jun 2011 11:27:44 +0000 (13:27 +0200)
committerJens Axboe <[email protected]>
Mon, 20 Jun 2011 11:27:44 +0000 (13:27 +0200)
POLLOUT should be returned only if bd->queued_cmds < bd->max_queue
so that bsg_alloc_command() can proceed.

Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: FUJITA Tomonori <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
block/bsg.c

index 0c8b64a16484721308587c7a6b635344a9144a1e..c4f49e255751ff473a9c5970ae9050f52b07a210 100644 (file)
@@ -878,7 +878,7 @@ static unsigned int bsg_poll(struct file *file, poll_table *wait)
        spin_lock_irq(&bd->lock);
        if (!list_empty(&bd->done_list))
                mask |= POLLIN | POLLRDNORM;
-       if (bd->queued_cmds >= bd->max_queue)
+       if (bd->queued_cmds < bd->max_queue)
                mask |= POLLOUT;
        spin_unlock_irq(&bd->lock);
 
This page took 0.050665 seconds and 4 git commands to generate.