From: Christoph Hellwig <hch@lst.de>
To: Dan Williams <dan.j.williams@intel.com>, Jens Axboe <axboe@kernel.dk>
Cc: Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
linux-block@vger.kernel.org, nvdimm@lists.linux.dev
Subject: [PATCH 1/3] nvdimm/pmem: fix creating the dax group
Date: Mon, 20 Sep 2021 09:27:24 +0200 [thread overview]
Message-ID: <20210920072726.1159572-2-hch@lst.de> (raw)
In-Reply-To: <20210920072726.1159572-1-hch@lst.de>
The recent block layer refactoring broke the way how the pmem driver
abused device_add_disk. Fix this by properly passing the attribute groups
to device_add_disk.
Fixes: 52b85909f85d ("block: fold register_disk into device_add_disk")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvdimm/pmem.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 72de88ff0d30d..ef4950f808326 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev,
struct nd_pfn_sb *pfn_sb;
struct pmem_device *pmem;
struct request_queue *q;
- struct device *gendev;
struct gendisk *disk;
void *addr;
int rc;
@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev,
}
dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
pmem->dax_dev = dax_dev;
- gendev = disk_to_dev(disk);
- gendev->groups = pmem_attribute_groups;
- device_add_disk(dev, disk, NULL);
+ device_add_disk(dev, disk, pmem_attribute_groups);
if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
return -ENOMEM;
--
2.30.2
next prev parent reply other threads:[~2021-09-20 7:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-20 7:27 fix a dax/block device attribute registration regression Christoph Hellwig
2021-09-20 7:27 ` Christoph Hellwig [this message]
2021-09-20 22:52 ` [PATCH 1/3] nvdimm/pmem: fix creating the dax group Ira Weiny
2021-09-20 23:09 ` Dan Williams
2021-09-20 7:27 ` [PATCH 2/3] nvdimm/pmem: move dax_attribute_group from dax to pmem Christoph Hellwig
2021-09-20 18:00 ` kernel test robot
2021-09-20 23:29 ` Dan Williams
2021-09-20 22:51 ` Ira Weiny
2021-09-20 23:36 ` Dan Williams
2021-09-20 23:37 ` Dan Williams
2021-09-20 7:27 ` [PATCH 3/3] block: warn if ->groups is set when calling add_disk Christoph Hellwig
2021-09-20 22:52 ` Ira Weiny
2021-09-20 23:50 ` Dan Williams
2021-09-21 6:32 ` Christoph Hellwig
2021-09-22 17:34 dax_supported() related cleanups v2 Christoph Hellwig
2021-09-22 17:34 ` [PATCH 1/3] nvdimm/pmem: fix creating the dax group Christoph Hellwig
2021-09-22 18:33 fix a dax/block device attribute registration regression Christoph Hellwig
2021-09-22 18:33 ` [PATCH 1/3] nvdimm/pmem: fix creating the dax group 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=20210920072726.1159572-2-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.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).