Re: [PATCH] writeback: fix NULL dereference when device is gone

From: Tejun Heo
Date: Mon Aug 19 2013 - 19:02:49 EST


On Tue, Aug 20, 2013 at 12:45:53AM +0200, Peter Wu wrote:
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 68851ff..6e38a8b 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -1007,7 +1007,8 @@ void bdi_writeback_workfn(struct work_struct *work)
> struct backing_dev_info *bdi = wb->bdi;
> long pages_written;
>
> - set_worker_desc("flush-%s", dev_name(bdi->dev));
> + if (bdi->dev)
> + set_worker_desc("flush-%s", dev_name(bdi->dev));

Hmmm... bdi->dev is cleared after bdi_wb_shutdown() so the work item
should no longer be running. It seems like something is queueing the
work item after shutdown and the proper fix would be finding out which
and fixing it. Can you please verify whether adding
WARN_ON(!bdi->dev) in bdi_wakeup_thread_delayed() trigger anything?

Thanks.

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