mbox series

[0/9] block: 5th batch of add_disk() error handling conversions

Message ID 20210902174105.2418771-1-mcgrof@kernel.org
Headers show
Series block: 5th batch of add_disk() error handling conversions | expand

Message

Luis Chamberlain Sept. 2, 2021, 5:40 p.m. UTC
This is the 5th of 7 set of driver conversion over to use the new
add_disk() error handling. Please let me know if you spot
any issues. This set deals with miscellaneous block drivers.

This patch set is based on axboe/master, you can find the
full set of changes on my 20210901-for-axboe-add-disk-error-handling
branch [0].

It would seem there are going to be a total of 7 sets of patches. The
next one will be the wonderful and exciting world of floppy drivers.
The last is the required changes to add a __must_check for the return
value for the caller.

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

Luis Chamberlain (9):
  cdrom/gdrom: add error handling support for add_disk()
  ms_block: add error handling support for add_disk()
  mspro_block: add error handling support for add_disk()
  rbd: add add_disk() error handling
  mtd: add add_disk() error handling
  s390/block/dasd_genhd: add error handling support for add_disk()
  s390/block/dcssblk: add error handling support for add_disk()
  s390/block/scm_blk: add error handling support for add_disk()
  s390/block/xpram: add error handling support for add_disk()

 drivers/block/rbd.c                 | 6 +++++-
 drivers/cdrom/gdrom.c               | 7 ++++++-
 drivers/memstick/core/ms_block.c    | 6 +++++-
 drivers/memstick/core/mspro_block.c | 6 +++++-
 drivers/mtd/mtd_blkdevs.c           | 6 +++++-
 drivers/s390/block/dasd_genhd.c     | 8 ++++++--
 drivers/s390/block/dcssblk.c        | 4 +++-
 drivers/s390/block/scm_blk.c        | 7 ++++++-
 drivers/s390/block/xpram.c          | 4 +++-
 9 files changed, 44 insertions(+), 10 deletions(-)

Comments

Miquel Raynal Sept. 2, 2021, 7:09 p.m. UTC | #1
Hi Luis,

Luis Chamberlain <mcgrof@kernel.org> wrote on Thu,  2 Sep 2021 10:41:01
-0700:

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

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl
Heiko Carstens Sept. 3, 2021, 2:06 p.m. UTC | #2
On Thu, Sep 02, 2021 at 10:41:05AM -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>
> ---
>  drivers/s390/block/xpram.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
> index ce98fab4d43c..ed3904b6a9c8 100644
> --- a/drivers/s390/block/xpram.c
> +++ b/drivers/s390/block/xpram.c
> @@ -371,7 +371,9 @@ static int __init xpram_setup_blkdev(void)
>  		disk->private_data = &xpram_devices[i];
>  		sprintf(disk->disk_name, "slram%d", i);
>  		set_capacity(disk, xpram_sizes[i] << 1);
> -		add_disk(disk);
> +		rc = add_disk(disk);
> +		if (rc)
> +			goto out;

Hmm, this is a more or less dead device driver, and I'm wondering if
we shouldn't remove it instead. But anyway, your patch is not correct:

- del_gendisk for all registered disks has to be called
- unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME) is missing as well

That would be more or or less xpram_exit with parameter.

You can send a new patch or I can provide a proper one, whatever you
prefer.
Heiko Carstens Sept. 3, 2021, 2:30 p.m. UTC | #3
On Thu, Sep 02, 2021 at 10:41:04AM -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>
> ---
>  drivers/s390/block/scm_blk.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Christoph Hellwig Sept. 6, 2021, 9:15 a.m. UTC | #4
On Fri, Sep 03, 2021 at 04:06:15PM +0200, Heiko Carstens wrote:
> Hmm, this is a more or less dead device driver, and I'm wondering if
> we shouldn't remove it instead. But anyway, your patch is not correct:

I'm all for removing it.  I think we need to do a little more spring
cleaning on unmaintained and likely to be unused block drivers.
Heiko Carstens Sept. 6, 2021, 2:35 p.m. UTC | #5
On Mon, Sep 06, 2021 at 10:15:40AM +0100, Christoph Hellwig wrote:
> On Fri, Sep 03, 2021 at 04:06:15PM +0200, Heiko Carstens wrote:
> > Hmm, this is a more or less dead device driver, and I'm wondering if
> > we shouldn't remove it instead. But anyway, your patch is not correct:
> 
> I'm all for removing it.  I think we need to do a little more spring
> cleaning on unmaintained and likely to be unused block drivers.

Yes, we'll remove it. I'll schedule it even for this merge
window. Should be away with -rc1.