Re: [PATCH 1/1] mm/backing-dev.c: Call del_timer_sync instead ofdel_timer

From: Andrew Morton
Date: Thu Sep 01 2011 - 17:33:46 EST


On Thu, 1 Sep 2011 21:27:02 +0530
Kautuk Consul <consul.kautuk@xxxxxxxxx> wrote:

> This is important for SMP scenario, to check whether the timer
> callback is executing on another CPU when we are deleting the
> timer.
>

I don't see why?

> index d6edf8d..754b35a 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -385,7 +385,7 @@ static int bdi_forker_thread(void *ptr)
> * dirty data on the default backing_dev_info
> */
> if (wb_has_dirty_io(me) || !list_empty(&me->bdi->work_list)) {
> - del_timer(&me->wakeup_timer);
> + del_timer_sync(&me->wakeup_timer);
> wb_do_writeback(me, 0);
> }

It isn't a use-after-free fix: bdi_unregister() safely shoots down any
running timer.

Please completely explain what you believe the problem is here.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/