From: Christoph Hellwig <hch@lst.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: martin.petersen@oracle.com, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Bart Van Assche <bart.vanassche@sandisk.com>,
Omar Sandoval <osandov@osandov.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes
Date: Mon, 30 Jan 2017 13:24:52 +0100 [thread overview]
Message-ID: <20170130122452.GA9043@lst.de> (raw)
In-Reply-To: <148566590827.1627.3631056985359212959.stgit@dwillia2-desk3.amr.corp.intel.com>
Hi Dan,
this looks mostly fine to me. A few code comments below, but except
for this there is another issue with it: We still have drivers
that share a single request_queue for multiple gendisks, so I wonder
Also I think you probably want one patch for the block framework,
and one to switch SCSI over to it.
> +struct disk_devt {
> + struct kref kref;
> + void (*release)(struct kref *);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> + if (disk_devt)
> + kref_put(&disk_devt->kref, disk_devt->release);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> + if (disk_devt)
> + kref_get(&disk_devt->kref);
> +}
Given that we have a user-supplied release callack I'd much rather get
rid of the kref here, use a normal atomic_t and pass the disk_devt
structure to the release callback then a kref.
next prev parent reply other threads:[~2017-01-30 12:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-29 4:58 [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes Dan Williams
2017-01-30 7:05 ` Hannes Reinecke
2017-01-30 7:22 ` Omar Sandoval
2017-01-30 7:46 ` Dan Williams
2017-01-30 12:24 ` Christoph Hellwig [this message]
2017-01-30 20:57 ` Dan Williams
2017-02-01 8:08 ` Christoph Hellwig
2017-01-30 21:53 ` Dan Williams
2017-02-01 8:07 ` Christoph Hellwig
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=20170130122452.GA9043@lst.de \
--to=hch@lst.de \
--cc=James.Bottomley@hansenpartnership.com \
--cc=axboe@kernel.dk \
--cc=bart.vanassche@sandisk.com \
--cc=dan.j.williams@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=osandov@osandov.com \
/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).