Thread (15 messages) 15 messages, 3 authors, 2021-08-30
STALE1767d
Revisions (5)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v1 current
  4. v3 [diff vs current]
  5. v4 [diff vs current]

[PATCH 04/10] nvdimm/btt: do not call del_gendisk() if not needed

From: Luis Chamberlain <mcgrof@kernel.org>
Date: 2021-08-27 19:19:34
Also in: linux-bcache, linux-nvme, lkml, nvdimm, xen-devel
Subsystem: libnvdimm btt: block translation table, libnvdimm: non-volatile memory device subsystem, the rest · Maintainers: Vishal Verma, Dan Williams, Dave Jiang, Alison Schofield, Linus Torvalds

We know we don't need del_gendisk() if we haven't added
the disk, so just skip it. This should fix a bug on older
kernels, as del_gendisk() became able to deal with
disks not added only recently, after the patch titled
"block: add flag for add_disk() completion notation".

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 drivers/nvdimm/btt.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 92dec4952297..3fd1bdb9fc05 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1538,7 +1538,6 @@ static int btt_blk_init(struct btt *btt)
 		int rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt));
 
 		if (rc) {
-			del_gendisk(btt->btt_disk);
 			blk_cleanup_disk(btt->btt_disk);
 			return rc;
 		}
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help