Re: [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Davidlohr Bueso
Date: Wednesday, November 10, 2010 - 7:48 am

On Wed, 2010-11-10 at 21:58 +0800, Hillf Danton wrote:

How about something more like this:

diff --git a/block/bsg.c b/block/bsg.c
index f20d6a7..2663db3 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -870,7 +870,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);


Thanks,
Davidlohr





--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] fix the poll method of bsg file operations in ..., Davidlohr Bueso, (Wed Nov 10, 7:48 am)