LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org> To: Luis Chamberlain <mcgrof@kernel.org> Cc: Jens Axboe <axboe@kernel.dk>, justin@coraid.com, Ulf Hansson <ulf.hansson@linaro.org>, Hannes Reinecke <hare@suse.de>, Tejun Heo <tj@kernel.org>, Philipp Reisner <philipp.reisner@linbit.com>, Lars Ellenberg <lars.ellenberg@linbit.com>, Jeff Dike <jdike@addtoit.com>, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes.berg@intel.com>, chris.obbard@collabora.com, Gabriel Krisman Bertazi <krisman@collabora.com>, YiFei Zhu <zhuyifei1999@gmail.com>, thehajime@gmail.com, Chris Zankel <chris@zankel.net>, Max Filippov <jcmvbkbc@gmail.com>, Tim Waugh <tim@cyberelk.net>, "open list:TENSILICA XTENSA PORT (xtensa)" <linux-xtensa@linux-xtensa.org>, linux-um <linux-um@lists.infradead.org>, linux-m68k <linux-m68k@lists.linux-m68k.org>, Lars Ellenberg <drbd-dev@lists.linbit.com>, linux-block@vger.kernel.org, Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 01/15] z2ram: add error handling support for add_disk() Date: Wed, 1 Sep 2021 15:41:47 +0200 [thread overview] Message-ID: <CAMuHMdUUrp-ktVmOPRs7KinykrVKEMx-dG42RapPc-egxODNnQ@mail.gmail.com> (raw) In-Reply-To: <20210830221000.179369-2-mcgrof@kernel.org> Hi Luis, On Tue, Aug 31, 2021 at 12:10 AM Luis Chamberlain <mcgrof@kernel.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@kernel.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@linux-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
next prev parent reply other threads:[~2021-09-01 13:42 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-30 22:09 [PATCH 00/15] block: third batch of add_disk() error handling conversions Luis Chamberlain 2021-08-30 22:09 ` [PATCH 01/15] z2ram: add error handling support for add_disk() Luis Chamberlain 2021-09-01 13:41 ` Geert Uytterhoeven [this message] 2021-09-01 19:41 ` Luis Chamberlain 2021-08-30 22:09 ` [PATCH 02/15] aoe: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 03/15] m68k/emu/nfblock: " Luis Chamberlain 2021-09-01 13:43 ` Geert Uytterhoeven 2021-08-30 22:09 ` [PATCH 04/15] drbd: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 05/15] um/drivers/ubd_kern: " Luis Chamberlain 2021-09-01 15:24 ` Gabriel Krisman Bertazi 2021-08-30 22:09 ` [PATCH 06/15] xtensa/platforms/iss/simdisk: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 07/15] n64cart: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 08/15] pcd: move the identify buffer into pcd_identify Luis Chamberlain 2021-08-30 22:09 ` [PATCH 09/15] pcd: cleanup initialization Luis Chamberlain 2021-08-30 22:09 ` [PATCH 10/15] pf: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 11/15] pd: " Luis Chamberlain 2021-08-30 22:09 ` [PATCH 12/15] pcd: add error handling support for add_disk() Luis Chamberlain 2021-08-30 22:09 ` [PATCH 13/15] pcd: fix ordering of unregister_cdrom() Luis Chamberlain 2021-08-30 22:09 ` [PATCH 14/15] pcd: capture errors on cdrom_register() Luis Chamberlain 2021-08-30 22:10 ` [PATCH 15/15] pd: add error handling support for add_disk() Luis Chamberlain 2021-09-01 19:38 ` Luis Chamberlain
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAMuHMdUUrp-ktVmOPRs7KinykrVKEMx-dG42RapPc-egxODNnQ@mail.gmail.com \ --to=geert@linux-m68k.org \ --cc=anton.ivanov@cambridgegreys.com \ --cc=axboe@kernel.dk \ --cc=chris.obbard@collabora.com \ --cc=chris@zankel.net \ --cc=drbd-dev@lists.linbit.com \ --cc=hare@suse.de \ --cc=jcmvbkbc@gmail.com \ --cc=jdike@addtoit.com \ --cc=johannes.berg@intel.com \ --cc=justin@coraid.com \ --cc=krisman@collabora.com \ --cc=lars.ellenberg@linbit.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-m68k@lists.linux-m68k.org \ --cc=linux-um@lists.infradead.org \ --cc=linux-xtensa@linux-xtensa.org \ --cc=mcgrof@kernel.org \ --cc=philipp.reisner@linbit.com \ --cc=richard@nod.at \ --cc=thehajime@gmail.com \ --cc=tim@cyberelk.net \ --cc=tj@kernel.org \ --cc=ulf.hansson@linaro.org \ --cc=zhuyifei1999@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).