aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2011-06-20 07:27:44 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-06-20 07:27:44 -0400
commit80ceb057135ad77f513277f3bcd04b885501877a (patch)
tree78e4c78028097ddcf8229133701d6659bb44fa23 /block
parent2c53b436a30867eb6b47dd7bab23ba638d1fb0d2 (diff)
bsg: fix bsg_poll() to return POLLOUT properly
POLLOUT should be returned only if bd->queued_cmds < bd->max_queue so that bsg_alloc_command() can proceed. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 0c8b64a16484..c4f49e255751 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -878,7 +878,7 @@ static unsigned int bsg_poll(struct file *file, poll_table *wait)
878 spin_lock_irq(&bd->lock); 878 spin_lock_irq(&bd->lock);
879 if (!list_empty(&bd->done_list)) 879 if (!list_empty(&bd->done_list))
880 mask |= POLLIN | POLLRDNORM; 880 mask |= POLLIN | POLLRDNORM;
881 if (bd->queued_cmds >= bd->max_queue) 881 if (bd->queued_cmds < bd->max_queue)
882 mask |= POLLOUT; 882 mask |= POLLOUT;
883 spin_unlock_irq(&bd->lock); 883 spin_unlock_irq(&bd->lock);
884 884