lkml.org 
[lkml]   [2007]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: libata-core.c: unsafe cancel_delayed_work() usage?
On 05/01, Jeff Garzik wrote:
>
> Oleg Nesterov wrote:
> >
> >Alan, the usage of cancel_delayed_work() in drivers/ata/libata-core.c looks
> >suspicious to me, both ->hotplug_task and ->port_task can re-arm
> >themselves,
> >so cancel_delayed_work + flush_workqueue (or cancel_work_sync) is not
> >enough.
> >
> >Could you confirm/nack my understanding?
>
> For all rearming workqueues, one must use cancel-rearming-blahblah.

Well, yes and no. cancel_rearming_delayed_work() requires that dwork
re-arms itself unconditionally, otherwise it just hangs (actually, the
patch to fix this shortcoming is ready). However, ata_pio_task() for
example, re-arms only when ATA_BUSY.

So it is very possible that the code is correct, if the caller of
ata_port_flush_task() ensures that ATA_BUSY is not possible. Otherwise
we should change cancel_rearming_delayed_work() and use it.

Oleg.

-
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/

\
 
 \ /
  Last update: 2007-05-02 01:51    [W:0.035 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site