2021-10-18 03:25:49

by Luis Chamberlain

[permalink] [raw]
Subject: [PATCH 00/13] block: add_disk() error handling stragglers

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


2021-10-18 03:25:54

by Luis Chamberlain

[permalink] [raw]
Subject: [PATCH 09/13] z2ram: add error handling support for add_disk()

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 <[email protected]>
---
drivers/block/z2ram.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 4eef218108c6..ccc52c935faf 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -318,6 +318,7 @@ static const struct blk_mq_ops z2_mq_ops = {
static int z2ram_register_disk(int minor)
{
struct gendisk *disk;
+ int err;

disk = blk_mq_alloc_disk(&tag_set, NULL);
if (IS_ERR(disk))
@@ -333,8 +334,10 @@ static int z2ram_register_disk(int minor)
sprintf(disk->disk_name, "z2ram");

z2ram_gendisk[minor] = disk;
- add_disk(disk);
- return 0;
+ err = add_disk(disk);
+ if (err)
+ blk_cleanup_disk(disk);
+ return err;
}

static int __init z2_init(void)
--
2.30.2

2021-10-18 03:45:52

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH 00/13] block: add_disk() error handling stragglers

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

2021-10-18 16:19:19

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 00/13] block: add_disk() error handling stragglers

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:
> > 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?

Sure, although the second to last patch is in a state of flux given
the ataflop driver currently is broken and so we're seeing how to fix
that first:

https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20211011-for-axboe-add-disk-error-handling

Luis

2021-10-22 03:13:47

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH 00/13] block: add_disk() error handling stragglers

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:
>> 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?
>
> Sure, although the second to last patch is in a state of flux given
> the ataflop driver currently is broken and so we're seeing how to fix
> that first:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20211011-for-axboe-add-disk-error-handling

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

2021-10-25 16:01:56

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 00/13] block: add_disk() error handling stragglers

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:
> > 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:
> >>> 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?
> >
> > Sure, although the second to last patch is in a state of flux given
> > the ataflop driver currently is broken and so we're seeing how to fix
> > that first:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20211011-for-axboe-add-disk-error-handling
>
> 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.

If you just want to test the ps3 changes, I've put this branch together
just for yo, its based on v5.15-rc6:

https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=20211025-ps3-add-disk

Luis

2021-10-30 17:06:06

by Jens Axboe

[permalink] [raw]
Subject: Re: (subset) [PATCH 00/13] block: add_disk() error handling stragglers

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


2021-10-30 17:10:01

by Jens Axboe

[permalink] [raw]
Subject: Re: (subset) [PATCH 00/13] block: add_disk() error handling stragglers

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