Re: [PATCHv2] backing-dev: fix wakeup timer races withbdi_unregister()

From: Wu Fengguang
Date: Tue Jan 31 2012 - 08:34:08 EST


On Thu, Jan 19, 2012 at 10:20:20PM +0530, Rabin Vincent wrote:
> While 7a401a972df8e18 ("backing-dev: ensure wakeup_timer is deleted")
> addressed the problem of the bdi being freed with a queued wakeup
> timer, there are other races that could happen if the wakeup timer
> expires after/during bdi_unregister(), before bdi_destroy() is called.
>
> wakeup_timer_fn() could attempt to wakeup a task which has already has
> been freed, or could access a NULL bdi->dev via the wake_forker_thread
> tracepoint.
>
> Cc: Jens Axboe <axboe@xxxxxxxxx>
> Cc: Wu Fengguang <fengguang.wu@xxxxxxxxx>
> Reported-by: Chanho Min <chanho.min@xxxxxxx>
> Signed-off-by: Rabin Vincent <rabin@xxxxxx>
> ---

Thanks. I just pushed it to linux-next, together with this related one:

Subject: writeback: fix NULL bdi->dev in trace writeback_single_inode
Date: Tue Jan 17 11:18:56 CST 2012

bdi_prune_sb() resets sb->s_bdi to default_backing_dev_info when the
tearing down the original bdi. Fix trace_writeback_single_inode to
use sb->s_bdi=default_backing_dev_info rather than bdi->dev=NULL for a
teared down bdi.

Reported-by: Rabin Vincent <rabin@xxxxxx>
Tested-by: Rabin Vincent <rabin@xxxxxx>
Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>

Thanks,
Fengguang
--
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/