[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUUrp-ktVmOPRs7KinykrVKEMx-dG42RapPc-egxODNnQ@mail.gmail.com>
Date: Wed, 1 Sep 2021 15:41:47 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>, justin@...aid.com,
Ulf Hansson <ulf.hansson@...aro.org>,
Hannes Reinecke <hare@...e.de>, Tejun Heo <tj@...nel.org>,
Philipp Reisner <philipp.reisner@...bit.com>,
Lars Ellenberg <lars.ellenberg@...bit.com>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes.berg@...el.com>,
chris.obbard@...labora.com,
Gabriel Krisman Bertazi <krisman@...labora.com>,
YiFei Zhu <zhuyifei1999@...il.com>, thehajime@...il.com,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
Tim Waugh <tim@...erelk.net>,
"open list:TENSILICA XTENSA PORT (xtensa)"
<linux-xtensa@...ux-xtensa.org>,
linux-um <linux-um@...ts.infradead.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Lars Ellenberg <drbd-dev@...ts.linbit.com>,
linux-block@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 01/15] z2ram: add error handling support for add_disk()
Hi Luis,
On Tue, Aug 31, 2021 at 12:10 AM Luis Chamberlain <mcgrof@...nel.org> 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. Only the disk is cleaned up inside
> z2ram_register_disk() as the caller deals with the rest.
>
> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Thanks for your patch!
> --- 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_cleaup_disk(disk);
blk_cleanup_disk()?
Seems like lkp already detected this back in July...
> + return err;
> }
>
> static int __init z2_init(void)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists