linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] bdi: Avoid oops on device removal
Date: Thu, 27 Feb 2014 15:07:48 -0500	[thread overview]
Message-ID: <20140227200748.GA466@htj.dyndns.org> (raw)
In-Reply-To: <1393367354-5172-3-git-send-email-jack@suse.cz>

Hello,

On Tue, Feb 25, 2014 at 11:29:14PM +0100, Jan Kara wrote:
> +static void bdi_wakeup_thread(struct backing_dev_info *bdi)
> +{
> +	spin_lock_bh(&bdi->wb_lock);
> +	if (test_bit(BDI_registered, &bdi->state))
> +		mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0);
> +	spin_unlock_bh(&bdi->wb_lock);
> +}

I wonder whether this can be smarter without requiring wb_lock each
timer but this probably is the simplest for -stable backports.

>  static void bdi_queue_work(struct backing_dev_info *bdi,
>  			   struct wb_writeback_work *work)
>  {
>  	trace_writeback_queue(bdi, work);
>  
>  	spin_lock_bh(&bdi->wb_lock);
> +	if (!test_bit(BDI_registered, &bdi->state)) {
> +		if (work->done)
> +			complete(work->done);
> +		goto out_unlock;
> +	}
>  	list_add_tail(&work->list, &bdi->work_list);
> -	spin_unlock_bh(&bdi->wb_lock);
> -
>  	mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0);
> +out_unlock:
> +	spin_unlock_bh(&bdi->wb_lock);
>  }
>  
> +
> +

Why three blank lines?

Other than that,

Reviewed-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2014-02-27 20:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 22:29 [PATCH 0/2] bdi fixes Jan Kara
2014-02-25 22:29 ` [PATCH 1/2] bdi: Fix hung task on sync Jan Kara
2014-02-25 22:43   ` Tejun Heo
2014-02-27 16:13     ` Jan Kara
2014-02-25 22:29 ` [PATCH 2/2] bdi: Avoid oops on device removal Jan Kara
2014-02-27 20:07   ` Tejun Heo [this message]
2014-02-27 21:32     ` Jan Kara
2014-02-27 21:43 [PATCH 0/2 v2] bdi: Fix hung tasks and oops in writeback Jan Kara
2014-02-27 21:43 ` [PATCH 2/2] bdi: Avoid oops on device removal Jan Kara

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=20140227200748.GA466@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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).