public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tejun Heo <tj@kernel.org>, Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	Omar Sandoval <osandov@osandov.com>,
	Arthur Marsh <arthur.marsh@internode.on.net>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/4] block: Allow bdi re-registration
Date: Wed, 08 Mar 2017 15:17:08 -0800	[thread overview]
Message-ID: <1489015028.24892.17.camel@HansenPartnership.com> (raw)
In-Reply-To: <20170308225542.GB21117@htj.duckdns.org>

On Wed, 2017-03-08 at 17:55 -0500, Tejun Heo wrote:
> Hello,
> 
> On Wed, Mar 08, 2017 at 05:48:31PM +0100, Jan Kara wrote:
> > @@ -710,6 +710,11 @@ static void cgwb_bdi_destroy(struct
> > backing_dev_info *bdi)
> >  	 */
> >  	atomic_dec(&bdi->usage_cnt);
> >  	wait_event(cgwb_release_wait, !atomic_read(&bdi
> > ->usage_cnt));
> > +	/*
> > +	 * Grab back our reference so that we hold it when @bdi
> > gets
> > +	 * re-registered.
> > +	 */
> > +	atomic_inc(&bdi->usage_cnt);
> 
> So, this is more re-initializing the ref to the initial state so that
> it can be re-used, right?  Maybe ATOMIC_INIT() is a better choice 
> here just to clarify what's going on?

Seconded.  Eventually this is going to get converted to a refcount_t
and it will dump a spurious warning on the 0->1 transition.  We can
avoid that by making this a proper initialization.

James

  reply	other threads:[~2017-03-08 23:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 16:48 [PATCH 0/4] block: Fixes for bdi handling Jan Kara
2017-03-08 16:48 ` [PATCH 1/4] block: Allow bdi re-registration Jan Kara
2017-03-08 22:55   ` Tejun Heo
2017-03-08 23:17     ` James Bottomley [this message]
2017-03-09  9:10     ` Jan Kara
2017-03-08 16:48 ` [PATCH 2/4] bdi: Fix use-after-free in wb_congested_put() Jan Kara
2017-03-08 22:56   ` Tejun Heo
2017-03-08 16:48 ` [PATCH 3/4] block: Make del_gendisk() safer for disks without queues Jan Kara
2017-03-08 22:57   ` Tejun Heo
2017-03-08 16:48 ` [PATCH 4/4] Revert "scsi, block: fix duplicate bdi name registration crashes" Jan Kara
2017-03-08 17:12   ` Dan Williams
2017-03-08 16:50 ` [PATCH 0/4] block: Fixes for bdi handling Omar Sandoval
2017-03-08 17:39   ` Omar Sandoval
2017-03-08 16:55 ` Jens Axboe
2017-03-09  9:05 ` Arthur Marsh
  -- strict thread matches above, loose matches on Subject: below --
2017-03-09 10:16 [PATCH 0/4 v2] " Jan Kara
2017-03-09 10:16 ` [PATCH 1/4] block: Allow bdi re-registration Jan Kara
2017-03-09 16:39   ` 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=1489015028.24892.17.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=arthur.marsh@internode.on.net \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=tj@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