* [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver
@ 2010-11-10 13:58 Hillf Danton
2010-11-10 14:48 ` Davidlohr Bueso
0 siblings, 1 reply; 3+ messages in thread
From: Hillf Danton @ 2010-11-10 13:58 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-scsi, Zou, Yi, Joe Eykholt
Though it looks like a typo, the check for POLLOUT is computed incorrectly.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
--- a/block/bsg.c 2010-09-13 07:07:38.000000000 +0800
+++ b/block/bsg.c 2010-11-10 21:40:30.000000000 +0800
@@ -874,6 +874,8 @@ static unsigned int bsg_poll(struct file
if (!list_empty(&bd->done_list))
mask |= POLLIN | POLLRDNORM;
if (bd->queued_cmds >= bd->max_queue)
+ ;
+ else
mask |= POLLOUT;
spin_unlock_irq(&bd->lock);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver
2010-11-10 13:58 [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver Hillf Danton
@ 2010-11-10 14:48 ` Davidlohr Bueso
2010-11-11 13:42 ` Hillf Danton
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2010-11-10 14:48 UTC (permalink / raw)
To: Hillf Danton; +Cc: linux-kernel, linux-scsi, Zou, Yi, Joe Eykholt
On Wed, 2010-11-10 at 21:58 +0800, Hillf Danton wrote:
> Though it looks like a typo, the check for POLLOUT is computed incorrectly.
>
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---
>
> --- a/block/bsg.c 2010-09-13 07:07:38.000000000 +0800
> +++ b/block/bsg.c 2010-11-10 21:40:30.000000000 +0800
> @@ -874,6 +874,8 @@ static unsigned int bsg_poll(struct file
> if (!list_empty(&bd->done_list))
> mask |= POLLIN | POLLRDNORM;
> if (bd->queued_cmds >= bd->max_queue)
> + ;
> + else
> mask |= POLLOUT;
> spin_unlock_irq(&bd->lock);
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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver
2010-11-10 14:48 ` Davidlohr Bueso
@ 2010-11-11 13:42 ` Hillf Danton
0 siblings, 0 replies; 3+ messages in thread
From: Hillf Danton @ 2010-11-11 13:42 UTC (permalink / raw)
To: dave; +Cc: linux-kernel, linux-scsi, Zou, Yi, Joe Eykholt
On Wed, Nov 10, 2010 at 10:48 PM, Davidlohr Bueso <dave@gnu.org> wrote:
> On Wed, 2010-11-10 at 21:58 +0800, Hillf Danton wrote:
>> Though it looks like a typo, the check for POLLOUT is computed incorrectly.
>>
>> Signed-off-by: Hillf Danton <dhillf@gmail.com>
>> ---
>>
>> --- a/block/bsg.c 2010-09-13 07:07:38.000000000 +0800
>> +++ b/block/bsg.c 2010-11-10 21:40:30.000000000 +0800
>> @@ -874,6 +874,8 @@ static unsigned int bsg_poll(struct file
>> if (!list_empty(&bd->done_list))
>> mask |= POLLIN | POLLRDNORM;
>> if (bd->queued_cmds >= bd->max_queue)
>> + ;
>> + else
>> mask |= POLLOUT;
>> spin_unlock_irq(&bd->lock);
>
> 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
>
cool, thanks//Hillf
>
>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-11 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10 13:58 [PATCH] fix the poll method of bsg file operations in Block layer SCSI generic driver Hillf Danton
2010-11-10 14:48 ` Davidlohr Bueso
2010-11-11 13:42 ` Hillf Danton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox