linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Wu <lekensteyn@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] writeback: fix NULL dereference when device is gone
Date: Mon, 19 Aug 2013 19:02:40 -0400	[thread overview]
Message-ID: <20130819230240.GA6869@mtj.dyndns.org> (raw)
In-Reply-To: <5177367.3UXkd1Z6lS@al>

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

  reply	other threads:[~2013-08-19 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  1:08 [3.11-rc5..] NULL pointer dereference in bdi_writeback_workfn Alan Stern
2013-08-19 22:45 ` [PATCH] writeback: fix NULL dereference when device is gone Peter Wu
2013-08-19 23:02   ` Tejun Heo [this message]
2013-08-20 10:13     ` Peter Wu
2013-08-20 13:33       ` Tejun Heo
2013-08-28 22:31         ` Peter Wu
2013-09-04 18:21           ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130819230240.GA6869@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=lekensteyn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).