From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FADAC433FE for ; Mon, 11 Apr 2022 14:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbiDKOqO (ORCPT ); Mon, 11 Apr 2022 10:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344434AbiDKOqM (ORCPT ); Mon, 11 Apr 2022 10:46:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3299613CC8; Mon, 11 Apr 2022 07:43:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BD42FB81643; Mon, 11 Apr 2022 14:43:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F802C385A4; Mon, 11 Apr 2022 14:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649688235; bh=Y3EfVQNNBs/0MytQNTHPYHrnCnnhOOTpdF06Qx+ClDs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faIHQj3pWM2LzvbpuXQNvIWWFousJEmGccimQP3wvJDnViaZpU8gaABucJE5IOd10 lyj+GTG4jX+avK4cSmQNRBgrfC6RE2tG2Cnw9IR+kAN8rUPdPqhEFP+QDsIgKq9u1q sFnyo4j+QdblCzuPSmMZ5i7B0Wvr/zuMAAiTtHew= Date: Mon, 11 Apr 2022 16:43:53 +0200 From: Greg Kroah-Hartman To: Valentin Kleibel Cc: stable@vger.kernel.org, Jens Axboe , Justin Sanders , linux-block@vger.kernel.org Subject: Re: [PATCH v2 1/2] block: add blk_alloc_disk and blk_cleanup_disk APIs Message-ID: References: <50ddedf1-5ac3-91c3-0b50-645ceb541071@vrvis.at> <9dd4a25a-7deb-fcdf-0c05-d37d4c894d86@vrvis.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Thu, Mar 31, 2022 at 12:00:08PM +0200, Valentin Kleibel wrote: > Add two new APIs to allocate and free a gendisk including the > request_queue for use with BIO based drivers. This is to avoid > boilerplate code in drivers. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Hannes Reinecke > Reviewed-by: Ulf Hansson > Link: https://lore.kernel.org/r/20210521055116.1053587-6-hch@lst.de > Signed-off-by: Jens Axboe > (cherry picked from commit f525464a8000f092c20b00eead3eaa9d849c599e) > Fixes: 3582dd291788 (aoe: convert aoeblk to blk-mq) > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215647 > Signed-off-by: Valentin Kleibel > --- > block/genhd.c | 15 +++++++++++++++ > include/linux/genhd.h | 1 + > 2 files changed, 16 insertions(+) > > diff --git a/block/genhd.c b/block/genhd.c > index 796baf761202..421cad085502 100644 > --- a/block/genhd.c > +++ b/block/genhd.c > @@ -1836,6 +1836,21 @@ void put_disk_and_module(struct gendisk *disk) > } > } > EXPORT_SYMBOL(put_disk_and_module); > +/** > + * blk_cleanup_disk - shutdown a gendisk allocated by blk_alloc_disk > + * @disk: gendisk to shutdown > + * > + * Mark the queue hanging off @disk DYING, drain all pending requests, then > mark > + * the queue DEAD, destroy and put it and the gendisk structure. > + * > + * Context: can sleep > + */ > +void blk_cleanup_disk(struct gendisk *disk) > +{ > + blk_cleanup_queue(disk->queue); > + put_disk(disk); > +} > +EXPORT_SYMBOL(blk_cleanup_disk); > > static void set_disk_ro_uevent(struct gendisk *gd, int ro) > { > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > index 03da3f603d30..b7b180d3734a 100644 > --- a/include/linux/genhd.h > +++ b/include/linux/genhd.h > @@ -369,6 +369,7 @@ extern void blk_unregister_region(dev_t devt, unsigned > long range); > #define alloc_disk(minors) alloc_disk_node(minors, NUMA_NO_NODE) > > int register_blkdev(unsigned int major, const char *name); > +void blk_cleanup_disk(struct gendisk *disk); > void unregister_blkdev(unsigned int major, const char *name); > > void revalidate_disk_size(struct gendisk *disk, bool verbose); This backport looks to be incomplete, and is also totally whitespace damaged and can not be applied at all :( Please fix both up and resend. thanks, greg k-h