Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp987655pxb; Fri, 15 Oct 2021 22:18:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ/OTkmzxCZc2GIl13S4k9dP4O+ZYpTRtf1kpe3JZ5f/aytc32nvbwTXjECsezSBOjttIs X-Received: by 2002:a17:906:b254:: with SMTP id ce20mr12509387ejb.306.1634361503524; Fri, 15 Oct 2021 22:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634361503; cv=none; d=google.com; s=arc-20160816; b=HzfqQnKN6/Lnaz2KvHVYnv0kQH/m5yd8QyKP+agzTJ15ZuFUYSdok+GoAePM8W98yX F2CxvuakEvRJI3GF4Jy0oAawk1dm6531om53mSywjk3XkqdOATGqu6Y928z/LtNBgwjc +kj/VPERnEzQ9u/qvUyovpS5+lyPMNM0KGnRAr2LQLCMHf8kkemi362LLuAQlvGCYyVC scKnu3Ubk9LxCRI/iw+NDypXwkQT6E3kfhQzEd56E0PB/Q/6/prmGLXakydlHa5ZwlLl RulbScynz4j8SokqnBWHpJGLuPJ683HN8ZE3dB44dLrL/G6DcOdIlcKpFwUW7s+6jUXx 6s7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OJE1Bf7T+5Ap+RZTSGrKa4CIK0Gy3l8yN0enZW1GlF0=; b=00YCjnOVmOxfVJ1tRM1y1Des49rf9SL4Nouuy4ZOC+jlVG7SND4wxYT8j8omxQ/+cS mPMLPhbbgYvoykzuONCxANx2sg4lO9Qve63DwB0yyeMhtWFv36yJ+dFhPvSQL4N82qtY v9xs+dZVJiqgcqLbDPu9osp1b9K9GXhRY/vWYOFAsj58Ji7HgSQ86XEmkJ1LjWP0SrjZ XWAXx+q1rWLkvt1LWWDWDGnvcPseV1N5cz+Vhjm8qRvHbVQOafEdo7NxGdxqudXhwu9p KObtHMtXrZ2a+Nh01NMEc3k9ZkIfOKdKYbPalZl9hlwLvSyti88+H8YiGRSUTVt3yecX KJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=s2Yefe2W; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si10563731ejc.561.2021.10.15.22.18.00; Fri, 15 Oct 2021 22:18:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=s2Yefe2W; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236381AbhJONdJ (ORCPT + 99 others); Fri, 15 Oct 2021 09:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236600AbhJONbz (ORCPT ); Fri, 15 Oct 2021 09:31:55 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8CD0C061769; Fri, 15 Oct 2021 06:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=OJE1Bf7T+5Ap+RZTSGrKa4CIK0Gy3l8yN0enZW1GlF0=; b=s2Yefe2WkhS2+bByeGDSInC1mG hzR3ei+YTAKfxzNNKZHP4DHpuc2rBP/q4lfDbZ8GZ13szI546kN47SszqVbVkn/5S7tjkqhLB/8/P /gTJh3NtfjMihDjTYfGcRaeDkfxAiJeiO3efC0k4Q8Gz3JvWJCwmR5f0kUGw6XoUwS2jgq+1TgBko Ay96YE/czQB23XWOkwUiQ44XDqa4++8b08zQQ6qtlqjRZfCjpdXks30HbtsXuJ3GamnGMNqhpXBph hXU7BR4MMr8ZVhH4tH78gv76KyQ23gcDb7rbzOTBYuun2DNAwUgbcZnJoNFp4wLGiuQb8qVbzJJW4 YP/sM33g==; Received: from [2001:4bb8:199:73c5:ddfe:9587:819b:83b0] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNFZ-007Diw-EG; Fri, 15 Oct 2021 13:27:53 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Coly Li , Mike Snitzer , Song Liu , David Sterba , Josef Bacik , "Theodore Ts'o" , OGAWA Hirofumi , Dave Kleikamp , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Kees Cook , Phillip Lougher , Jan Kara , linux-block@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, reiserfs-devel@vger.kernel.org, Jan Kara Subject: [PATCH 26/30] ext4: use sb_bdev_nr_blocks Date: Fri, 15 Oct 2021 15:26:39 +0200 Message-Id: <20211015132643.1621913-27-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211015132643.1621913-1-hch@lst.de> References: <20211015132643.1621913-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Acked-by: Theodore Ts'o --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0775950ee84e3..3dde8be5df490 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4468,7 +4468,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto cantfind_ext4; /* check blocks count against device size */ - blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; + blocks_count = sb_bdev_nr_blocks(sb); if (blocks_count && ext4_blocks_count(es) > blocks_count) { ext4_msg(sb, KERN_WARNING, "bad geometry: block count %llu " "exceeds size of device (%llu blocks)", -- 2.30.2