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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A7BEC6369E for ; Wed, 2 Dec 2020 21:53:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58464217A0 for ; Wed, 2 Dec 2020 21:53:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58464217A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5CF8A6B0036; Wed, 2 Dec 2020 16:53:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 558E86B005D; Wed, 2 Dec 2020 16:53:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 448AA6B0068; Wed, 2 Dec 2020 16:53:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 266E56B0036 for ; Wed, 2 Dec 2020 16:53:11 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DF289363B for ; Wed, 2 Dec 2020 21:53:10 +0000 (UTC) X-FDA: 77549693340.08.plant83_4e032bc273b6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id BC0091819E624 for ; Wed, 2 Dec 2020 21:53:10 +0000 (UTC) X-HE-Tag: plant83_4e032bc273b6 X-Filterd-Recvd-Size: 4647 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 21:53:10 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id d5so2286417qtn.0 for ; Wed, 02 Dec 2020 13:53:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xaDA1tsZ1ItmC2prDcKEEQmNvQ5Pv10Cm/ao+ODU+y4=; b=iAPcnaL9YKd6C5p0FcenDd90I6RD+gVpzxd/eSeZ0xQt9GcZVQdiA4aFbSTs/OntKF p7Y2acKBQhXDYXWo0LiuqI/KD6vQlMJO13z+pLDB2QuNybKg1m/pVWVmKu0Igw6P/jia /DXVPfsqMlkEQtec7ecguK4XUNFOblt/c39xOX5fpFoMtLxgr8H1KlOio7aMcMZhKk2K P0y21tBmx5BAH6T0bfQyGSYF9ycee7/0ZbSmpi3ECjeU3GhFpb8FbcBQeN9K3Q/JN89z 5N5RnxqSLo8pVptxcNMrUYIZQQHWaNj5ZvRv+jvsPEmFnDurH/G5gMjlBmyWiKGkF/qC 5eGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=xaDA1tsZ1ItmC2prDcKEEQmNvQ5Pv10Cm/ao+ODU+y4=; b=DIgVp0jJM9Z5RzcIKAgsoqYufVWN0M70GN8Qegije+DM45Cr3DYtY+7it+y/pz5Ndr fb+kHGmjte/Dm2RP9QEPc+izk1vHZhvS6EjJ2TiO8iJHBVx7Oe6dpwhMU+cd9SaRSapA biXY0s+iBCcC4/VEz2KKu1WmGBe+jEST9buDnH6MfiJ0sexfdt5LRJ6chhFZIfT5nsFJ e6iLMCj7PeJpPBuHb5kOaCn/OUiK4PKrrTiRZgdm7NZDJ1U0NemIOtZBjXcZJFlRlMtG 2Xtj2+fpsAHnZKx9budc+ifk6u+7re2j0qWNxep+TtULKAgId4y/zClX5ALMNMdxkTMR gw9g== X-Gm-Message-State: AOAM532iZVnQsKWY9wRR6NuQeg3QKERF9q1knfwvr/VcWZulWjyEYzvd D+VpNUXc0mITyHtFkePm0AU= X-Google-Smtp-Source: ABdhPJx+RZ46UqXMazYzX5t9mfQ+j0OHEii8+THVYT62PhwFjG1kvFR63pEZgW/b3qE/vRtSjzPEFg== X-Received: by 2002:ac8:5b82:: with SMTP id a2mr245806qta.178.1606945989605; Wed, 02 Dec 2020 13:53:09 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:ec0f]) by smtp.gmail.com with ESMTPSA id n41sm223753qtb.18.2020.12.02.13.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 13:53:08 -0800 (PST) Date: Wed, 2 Dec 2020 16:52:40 -0500 From: Tejun Heo To: Christoph Hellwig Cc: Jens Axboe , Josef Bacik , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Jan Kara , Johannes Thumshirn , dm-devel@redhat.com, Jan Kara , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 25/45] block: simplify bdev/disk lookup in blkdev_get Message-ID: References: <20201128161510.347752-1-hch@lst.de> <20201128161510.347752-26-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201128161510.347752-26-hch@lst.de> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Nov 28, 2020 at 05:14:50PM +0100, Christoph Hellwig wrote: > To simplify block device lookup and a few other upcoming areas, make sure > that we always have a struct block_device available for each disk and > each partition, and only find existing block devices in bdget. The only > downside of this is that each device and partition uses a little more > memory. The upside will be that a lot of code can be simplified. > > With that all we need to look up the block device is to lookup the inode > and do a few sanity checks on the gendisk, instead of the separate lookup > for the gendisk. For blk-cgroup which wants to access a gendisk without > opening it, a new blkdev_{get,put}_no_open low-level interface is added > to replace the previous get_gendisk use. > > Note that the change to look up block device directly instead of the two > step lookup using struct gendisk causes a subtile change in behavior: > accessing a non-existing partition on an existing block device can now > cause a call to request_module. That call is harmless, and in practice > no recent system will access these nodes as they aren't created by udev > and static /dev/ setups are unusual. > > Signed-off-by: Christoph Hellwig It's already merged but FWIW looks great to me. Thank you. -- tejun