From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:24
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Luis Chamberlain (13):
block/brd: add error handling support for add_disk()
nvme-multipath: add error handling support for add_disk()
nvdimm/btt: do not call del_gendisk() if not needed
nvdimm/btt: use goto error labels on btt_blk_init()
nvdimm/btt: add error handling support for add_disk()
nvdimm/blk: avoid calling del_gendisk() on early failures
nvdimm/blk: add error handling support for add_disk()
zram: add error handling support for add_disk()
z2ram: add error handling support for add_disk()
ps3disk: add error handling support for add_disk()
ps3vram: add error handling support for add_disk()
block/sunvdc: add error handling support for add_disk()
mtd/ubi/block: add error handling support for add_disk()
drivers/block/brd.c | 9 +++++++--
drivers/block/ps3disk.c | 8 ++++++--
drivers/block/ps3vram.c | 7 ++++++-
drivers/block/sunvdc.c | 14 +++++++++++---
drivers/block/z2ram.c | 7 +++++--
drivers/block/zram/zram_drv.c | 6 +++++-
drivers/mtd/ubi/block.c | 8 +++++++-
drivers/nvdimm/blk.c | 21 +++++++++++++++------
drivers/nvdimm/btt.c | 24 +++++++++++++++---------
drivers/nvme/host/multipath.c | 14 ++++++++++++--
10 files changed, 89 insertions(+), 29 deletions(-)
--
2.30.2
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:52:58
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Since nvdimm/blk uses devm we just need to move the devm
registration towards the end. And in hindsight, that seems
to also provide a fix given del_gendisk() should not be
called unless the disk was already added via add_disk().
The probably of that issue happening is low though, like
OOM while calling devm_add_action(), so the fix is minor.
We manually unwind in case of add_disk() failure prior
to the devm registration.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvdimm/blk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -265,7 +265,9 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)}set_capacity(disk,available_disk_size>>SECTOR_SHIFT);-device_add_disk(dev,disk,NULL);+rc=device_add_disk(dev,disk,NULL);+if(rc)+gotoout_before_devm_err;/* nd_blk_release_disk() is called if this fails */if(devm_add_action_or_reset(dev,nd_blk_release_disk,disk))
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:03
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Since we now can tell for sure when a disk was added, move
setting the bit NVME_NSHEAD_DISK_LIVE only when we did
add the disk successfully.
Nothing to do here as the cleanup is done elsewhere. We take
care and use test_and_set_bit() because it is protects against
two nvme paths simultaneously calling device_add_disk() on the
same namespace head.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvme/host/multipath.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:03
This will make it easier to share common error paths.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvdimm/btt.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:05
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/brd.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -372,6 +372,7 @@ static int brd_alloc(int i)structbrd_device*brd;structgendisk*disk;charbuf[DISK_NAME_LEN];+interr=-ENOMEM;mutex_lock(&brd_devices_mutex);list_for_each_entry(brd,&brd_devices,brd_list){
@@ -422,16 +423,20 @@ static int brd_alloc(int i)/* Tell the block layer that this is not a rotational device */blk_queue_flag_set(QUEUE_FLAG_NONROT,disk->queue);blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM,disk->queue);-add_disk(disk);+err=add_disk(disk);+if(err)+gotoout_cleanup_disk;return0;+out_cleanup_disk:+blk_cleanup_disk(disk);out_free_dev:mutex_lock(&brd_devices_mutex);list_del(&brd->brd_list);mutex_unlock(&brd_devices_mutex);kfree(brd);-return-ENOMEM;+returnerr;}staticvoidbrd_probe(dev_tdev)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:06
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(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:08
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/ps3disk.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:11
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvdimm/blk.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
@@ -240,6 +240,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)resource_size_tavailable_disk_size;structgendisk*disk;u64internal_nlba;+intrc;internal_nlba=div_u64(nsblk->size,nsblk_internal_lbasize(nsblk));available_disk_size=internal_nlba*nsblk_sector_size(nsblk);
@@ -256,20 +257,26 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)blk_queue_logical_block_size(disk->queue,nsblk_sector_size(nsblk));blk_queue_flag_set(QUEUE_FLAG_NONROT,disk->queue);-if(devm_add_action_or_reset(dev,nd_blk_release_disk,disk))-return-ENOMEM;-if(nsblk_meta_size(nsblk)){-intrc=nd_integrity_init(disk,nsblk_meta_size(nsblk));+rc=nd_integrity_init(disk,nsblk_meta_size(nsblk));if(rc)-returnrc;+gotoout_before_devm_err;}set_capacity(disk,available_disk_size>>SECTOR_SHIFT);device_add_disk(dev,disk,NULL);++/* nd_blk_release_disk() is called if this fails */+if(devm_add_action_or_reset(dev,nd_blk_release_disk,disk))+return-ENOMEM;+nvdimm_check_and_set_ro(disk);return0;++out_before_devm_err:+blk_cleanup_disk(disk);+returnrc;}staticintnd_blk_probe(structdevice*dev)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:12
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
We re-use the same free tag call, so we also add a label for
that as well.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/sunvdc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
@@ -826,8 +826,8 @@ static int probe_disk(struct vdc_port *port)if(IS_ERR(g)){printk(KERN_ERRPFX"%s: Could not allocate gendisk.\n",port->vio.name);-blk_mq_free_tag_set(&port->tag_set);-returnPTR_ERR(g);+err=PTR_ERR(g);+gotoout_free_tag;}port->disk=g;
@@ -879,9 +879,17 @@ static int probe_disk(struct vdc_port *port)port->vdisk_size,(port->vdisk_size>>(20-9)),port->vio.ver.major,port->vio.ver.minor);-device_add_disk(&port->vio.vdev->dev,g,NULL);+err=device_add_disk(&port->vio.vdev->dev,g,NULL);+if(err)+gotoout_cleanup_disk;return0;++out_cleanup_disk:+blk_cleanup_disk(g);+out_free_tag:+blk_mq_free_tag_set(&port->tag_set);+returnerr;}staticstructldc_channel_configvdc_ldc_cfg={
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:13
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/mtd/ubi/block.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -447,12 +447,18 @@ int ubiblock_create(struct ubi_volume_info *vi)list_add_tail(&dev->list,&ubiblock_devices);/* Must be the last step: anyone can call file ops from now on */-add_disk(dev->gd);+ret=add_disk(dev->gd);+if(ret)+gotoout_destroy_wq;+dev_info(disk_to_dev(dev->gd),"created from ubi%d:%d(%s)",dev->ubi_num,dev->vol_id,vi->name);mutex_unlock(&devices_mutex);return0;+out_destroy_wq:+list_del(&dev->list);+destroy_workqueue(dev->wq);out_remove_minor:idr_remove(&ubiblock_minor_idr,gd->first_minor);out_cleanup_disk:
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:14
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvdimm/btt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:17
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/ps3vram.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -755,9 +755,14 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)dev_info(&dev->core,"%s: Using %llu MiB of GPU memory\n",gendisk->disk_name,get_capacity(gendisk)>>11);-device_add_disk(&dev->core,gendisk,NULL);+error=device_add_disk(&dev->core,gendisk,NULL);+if(error)+gotoout_cleanup_disk;+return0;+out_cleanup_disk:+blk_cleanup_disk(gendisk);out_cache_cleanup:remove_proc_entry(DEVICE_NAME,NULL);ps3vram_cache_cleanup(dev);
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:18
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/zram/zram_drv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-15 23:53:23
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling. Only the disk is cleaned up inside
z2ram_register_disk() as the caller deals with the rest.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/z2ram.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
From: Keith Busch <kbusch@kernel.org> Date: 2021-10-16 00:01:24
On Fri, Oct 15, 2021 at 04:52:08PM -0700, Luis Chamberlain wrote:
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Since we now can tell for sure when a disk was added, move
setting the bit NVME_NSHEAD_DISK_LIVE only when we did
add the disk successfully.
Nothing to do here as the cleanup is done elsewhere. We take
care and use test_and_set_bit() because it is protects against
two nvme paths simultaneously calling device_add_disk() on the
same namespace head.
Looks good, thank you.
Reviewed-by: Keith Busch <kbusch@kernel.org>
From: Dan Williams <hidden> Date: 2021-10-16 00:14:03
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Do you have a git repo with the patch set applied that I can use to test with?
Thanks.
-Geoff
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Since we now can tell for sure when a disk was added, move
setting the bit NVME_NSHEAD_DISK_LIVE only when we did
add the disk successfully.
Nothing to do here as the cleanup is done elsewhere. We take
care and use test_and_set_bit() because it is protects against
two nvme paths simultaneously calling device_add_disk() on the
same namespace head.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-18 16:16:32
On Sun, Oct 17, 2021 at 08:26:33AM -0700, Geoff Levand wrote:
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
quoted
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Do you have a git repo with the patch set applied that I can use to test with?
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-19 16:07:21
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
I'll remove this from my queue, any chance you can review the changes
for nvdimm/btt?
Luis
Hi Luis,
On 10/18/21 9:15 AM, Luis Chamberlain wrote:
On Sun, Oct 17, 2021 at 08:26:33AM -0700, Geoff Levand wrote:
quoted
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
quoted
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Do you have a git repo with the patch set applied that I can use to test with?
That branch has so many changes applied on top of the base v5.15-rc4
that the patches I need to apply to test on PS3 with don't apply.
Do you have something closer to say v5.15-rc5? Preferred would be
just your add_disk() error handling patches plus what they depend
on.
Thanks.
-Geoff
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-10-25 15:59:05
On Thu, Oct 21, 2021 at 08:10:49PM -0700, Geoff Levand wrote:
Hi Luis,
On 10/18/21 9:15 AM, Luis Chamberlain wrote:
quoted
On Sun, Oct 17, 2021 at 08:26:33AM -0700, Geoff Levand wrote:
quoted
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
quoted
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Do you have a git repo with the patch set applied that I can use to test with?
That branch has so many changes applied on top of the base v5.15-rc4
that the patches I need to apply to test on PS3 with don't apply.
Do you have something closer to say v5.15-rc5? Preferred would be
just your add_disk() error handling patches plus what they depend
on.
From: Minchan Kim <minchan@kernel.org> Date: 2021-10-25 16:55:09
On Fri, Oct 15, 2021 at 04:52:14PM -0700, Luis Chamberlain wrote:
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
I tested your 20211011-for-axboe-add-disk-error-handling branch
on PS3 and the ps3disk changes seem to be working OK.
Tested-by: Geoff Levand <geoff@infradead.org>
Hi Luis,
On 10/15/21 4:52 PM, Luis Chamberlain wrote:
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
I didn't yet test this ps3vram related change, but based
on the ps3disk testing I think this change will be OK.
Acked-by: Geoff Levand <geoff@infradead.org>
On Fri, 15 Oct 2021 16:52:06 -0700, Luis Chamberlain wrote:
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Luis Chamberlain (13):
block/brd: add error handling support for add_disk()
nvme-multipath: add error handling support for add_disk()
nvdimm/btt: do not call del_gendisk() if not needed
nvdimm/btt: use goto error labels on btt_blk_init()
nvdimm/btt: add error handling support for add_disk()
nvdimm/blk: avoid calling del_gendisk() on early failures
nvdimm/blk: add error handling support for add_disk()
zram: add error handling support for add_disk()
z2ram: add error handling support for add_disk()
ps3disk: add error handling support for add_disk()
ps3vram: add error handling support for add_disk()
block/sunvdc: add error handling support for add_disk()
mtd/ubi/block: add error handling support for add_disk()
[...]
Applied, thanks!
[08/13] zram: add error handling support for add_disk()
commit: 5e2e1cc4131cf4d21629c94331f2351b7dc8b87c
[10/13] ps3disk: add error handling support for add_disk()
commit: ff4cbe0fcf5d749f76040f782f0618656cd23e33
[11/13] ps3vram: add error handling support for add_disk()
commit: 3c30883acab1d20ecbd3c48dc12b147b51548742
Best regards,
--
Jens Axboe
On Fri, 15 Oct 2021 16:52:06 -0700, Luis Chamberlain wrote:
This patch set consists of al the straggler drivers for which we have
have no patch reviews done for yet. I'd like to ask for folks to please
consider chiming in, specially if you're the maintainer for the driver.
Additionally if you can specify if you'll take the patch in yourself or
if you want Jens to take it, that'd be great too.
Luis Chamberlain (13):
block/brd: add error handling support for add_disk()
nvme-multipath: add error handling support for add_disk()
nvdimm/btt: do not call del_gendisk() if not needed
nvdimm/btt: use goto error labels on btt_blk_init()
nvdimm/btt: add error handling support for add_disk()
nvdimm/blk: avoid calling del_gendisk() on early failures
nvdimm/blk: add error handling support for add_disk()
zram: add error handling support for add_disk()
z2ram: add error handling support for add_disk()
ps3disk: add error handling support for add_disk()
ps3vram: add error handling support for add_disk()
block/sunvdc: add error handling support for add_disk()
mtd/ubi/block: add error handling support for add_disk()
[...]
Applied, thanks!
[01/13] block/brd: add error handling support for add_disk()
commit: e1528830bd4ebf435d91c154e309e6e028336210
Best regards,
--
Jens Axboe
From: Dan Williams <hidden> Date: 2021-10-31 17:47:36
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
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".
Perhaps put this in:
commit $abbrev_commit ("block: add flag for add_disk() completion notation")
...format, but I can't seem to find that commit?
If you're touching the changelog how about one that clarifies the
impact and drops "we"?
"del_gendisk() is not required if the disk has not been added. On
kernels prior to commit $abbrev_commit ("block: add flag for
add_disk() completion notation")
it is mandatory to not call del_gendisk() if the underlying device has
not been through device_add()."
Fixes: 41cd8b70c37a ("libnvdimm, btt: add support for blk integrity")
With that you can add:
Reviewed-by: Dan Williams <redacted>
From: Dan Williams <hidden> Date: 2021-10-31 17:51:21
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted hunk
This will make it easier to share common error paths.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvdimm/btt.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
@@ -1520,10 +1520,11 @@ static int btt_blk_init(struct btt *btt){structnd_btt*nd_btt=btt->nd_btt;structnd_namespace_common*ndns=nd_btt->ndns;+intrc=-ENOMEM;btt->btt_disk=blk_alloc_disk(NUMA_NO_NODE);if(!btt->btt_disk)-return-ENOMEM;+gotoout;
I tend to not use a goto when there is nothing to unwind.
The rest looks good to me. After dropping "goto out;" you can add:
Reviewed-by: Dan Williams <redacted>
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-11-02 17:04:23
On Sun, Oct 31, 2021 at 10:47:22AM -0700, Dan Williams wrote:
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
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".
Perhaps put this in:
commit $abbrev_commit ("block: add flag for add_disk() completion notation")
...format, but I can't seem to find that commit?
Indeed, that patch got dropped and it would seem Christoph preferred
a simpler approach with the new disk_live()
commit 40b3a52ffc5bc3b5427d5d35b035cfb19d03fdd6
Author: Christoph Hellwig [off-list ref]
Date: Wed Aug 18 16:45:32 2021 +0200
block: add a sanity check for a live disk in del_gendisk
If you're touching the changelog how about one that clarifies the
impact and drops "we"?
"del_gendisk() is not required if the disk has not been added. On
kernels prior to commit $abbrev_commit ("block: add flag for
add_disk() completion notation")
it is mandatory to not call del_gendisk() if the underlying device has
not been through device_add()."
Fixes: 41cd8b70c37a ("libnvdimm, btt: add support for blk integrity")
With that you can add:
Reviewed-by: Dan Williams <redacted>
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-11-03 00:11:09
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Curious if are you going to nuking it on v5.16? Otherwise it would stand
in the way of the last few patches to add __must_check for the final
add_disk() error handling changes.
Luis
From: Dan Williams <hidden> Date: 2021-11-03 00:49:27
On Tue, Nov 2, 2021 at 5:10 PM Luis Chamberlain [off-list ref] wrote:
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
quoted
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Curious if are you going to nuking it on v5.16? Otherwise it would stand
in the way of the last few patches to add __must_check for the final
add_disk() error handling changes.
True, I don't think I can get it nuked in time, so you can add my
Reviewed-by for this one.
On Tue, Nov 2, 2021 at 5:10 PM Luis Chamberlain [off-list ref] wrote:
quoted
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
quoted
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Curious if are you going to nuking it on v5.16? Otherwise it would stand
in the way of the last few patches to add __must_check for the final
add_disk() error handling changes.
True, I don't think I can get it nuked in time, so you can add my
Reviewed-by for this one.
Luis, I lost track of the nv* patches from this discussion. If you want
them in 5.16 and they are reviewed, please do resend and I'll pick them
up for the middle-of-merge-window push.
--
Jens Axboe
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-11-03 12:08:46
On Tue, Nov 02, 2021 at 05:49:12PM -0700, Dan Williams wrote:
On Tue, Nov 2, 2021 at 5:10 PM Luis Chamberlain [off-list ref] wrote:
quoted
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
quoted
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Curious if are you going to nuking it on v5.16? Otherwise it would stand
in the way of the last few patches to add __must_check for the final
add_disk() error handling changes.
True, I don't think I can get it nuked in time, so you can add my
Reviewed-by for this one.
This patch required the previous patch in this series to also be
applied. Can I apply your Reviewed-by there too?
Luis
From: Luis Chamberlain <mcgrof@kernel.org> Date: 2021-11-03 12:09:37
On Tue, Nov 02, 2021 at 07:28:02PM -0600, Jens Axboe wrote:
On 11/2/21 6:49 PM, Dan Williams wrote:
quoted
On Tue, Nov 2, 2021 at 5:10 PM Luis Chamberlain [off-list ref] wrote:
quoted
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
quoted
On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [off-list ref] wrote:
quoted
If nd_integrity_init() fails we'd get del_gendisk() called,
but that's not correct as we should only call that if we're
done with device_add_disk(). Fix this by providing unwinding
prior to the devm call being registered and moving the devm
registration to the very end.
This should fix calling del_gendisk() if nd_integrity_init()
fails. I only spotted this issue through code inspection. It
does not fix any real world bug.
Just fyi, I'm preparing patches to delete this driver completely as it
is unused by any shipping platform. I hope to get that removal into
v5.16.
Curious if are you going to nuking it on v5.16? Otherwise it would stand
in the way of the last few patches to add __must_check for the final
add_disk() error handling changes.
True, I don't think I can get it nuked in time, so you can add my
Reviewed-by for this one.
Luis, I lost track of the nv* patches from this discussion. If you want
them in 5.16 and they are reviewed, please do resend and I'll pick them
up for the middle-of-merge-window push.
Sure thing, I'll resend whatever is left. I also noticed for some reason
I forgot to convert nvdimm/pmem and so I'll roll those new patches in,
but I suspect that those might be too late unless we get them reviewed
in time.
Luis