From patchwork Wed Nov 13 09:47:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13895566 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FBDFE7716D for ; Thu, 5 Dec 2024 15:27:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B1F26B0109; Thu, 5 Dec 2024 10:19:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3821B6B00DE; Thu, 5 Dec 2024 10:19:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8649E6B010A; Thu, 5 Dec 2024 10:19:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 07FE26B00CB for ; Wed, 13 Nov 2024 04:47:37 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BE5944094C for ; Wed, 13 Nov 2024 09:47:36 +0000 (UTC) X-FDA: 82780593252.22.32D51E4 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf24.hostedemail.com (Postfix) with ESMTP id 7760C18000D for ; Wed, 13 Nov 2024 09:47:29 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="z+/DD2ks"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine); spf=none (imf24.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731491192; a=rsa-sha256; cv=none; b=Gbz348o/B+mKIIz4EtUj//RwubA8aKC8OCnLtp3Nel+TGosJx2miZa6FqgCrR9a7fyIO3r xq7K6p93QzVXj+DfghRz8sKSj5YfTMO0LcVWbel4vcK7NySqPJ7rbtcvjGGr9a1yGUzbRW xRfilACr1sIJgBUUUss+4/nELNpICIk= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="z+/DD2ks"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine); spf=none (imf24.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731491192; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mZYiYHdxBbyR/19PnV0dX82l4+th0pXaG9WcUHT6G/o=; b=jqBibk8MGdawaREoytsWtMgQlfFiHWKGfVVSt9YZCbwDRfpLGvA8CZLRQfQvxJzE1xO+m7 wBnG9ADUpWq0wKldfEAEpPphAMr8FJjE5oIbBEKOiHEhJu7KUQ6UO0fxxFlw/cqN3sSRac USNVG3LOGTYH0iGLqRjZx+mnrNAvjk0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=mZYiYHdxBbyR/19PnV0dX82l4+th0pXaG9WcUHT6G/o=; b=z+/DD2ksIIMD99dpwbTEHn8k4O pHg7uHS7eT094skjM9TFMiJ1EniWkjT9HGAw2UunxTT+sN5NEc0TVmCFons1UrnsgzgUrFtgdMgAA zpf3glrmYXKcRmnb6yD71kaZaua4QRrNfvPkOWhj9eWg8lFK/pcT+kIGHV5CWnC6rY4K05AxlyQGQ MNVmgP7cOXDVgnvxewh+FESw9UIPM4X8JwlqSq1KDpZfJCJvo87OGEDT+Mg+bP2H8xuptX9LBOIk/ /hFwEUAGV3O/VZjpRAj6p50xbFOpUl2RhdqH8S/bLLJ6RBn47IsUnnziFAeqODl4eodR/DLjxEOJc juHAjElA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tB9yD-00000006HdQ-3YUj; Wed, 13 Nov 2024 09:47:29 +0000 From: Luis Chamberlain To: willy@infradead.org, hch@lst.de, hare@suse.de, david@fromorbit.com, djwong@kernel.org Cc: john.g.garry@oracle.com, ritesh.list@gmail.com, kbusch@kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, kernel@pankajraghav.com, mcgrof@kernel.org Subject: [RFC 7/8] nvme: remove superfluous block size check Date: Wed, 13 Nov 2024 01:47:26 -0800 Message-ID: <20241113094727.1497722-8-mcgrof@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241113094727.1497722-1-mcgrof@kernel.org> References: <20241113094727.1497722-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspamd-Queue-Id: 7760C18000D X-Rspamd-Server: rspam01 X-Stat-Signature: foufcgx5c6yun5rdxdw3abjio7runxey X-Rspam: Yes X-HE-Tag: 1731491249-846617 X-HE-Meta: U2FsdGVkX18+5gx/1xp1sGIT6UMnaUBRxYb540+CGWBjIUayKANmxCiUrBpHCWXIABdtOl1YDtXiWxBmyEa3wlX2p2NJcEdwXIjbfBg8yxmCy0VncyzXYRRrQrInY3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YYPv3xjtq5IUBoKbXFq6siHkqQgl4KW0Vja86bCF0YrsuMZLuc2D0PJ/N1orp7vFG2w256VDqTnMCz6/Ba5FxuGC9PS9IJ65/iXcgdlscrXvZQJD05bS+77RYVpz2i1RMCEhvYQkPDpL5iK2PbxFnsVidntc8IG3ev/ZAQ5NaM0cdoAr8QtFP6RDmFbqgRJjIMKONyvrjguRudli6l9FFC3EfXaUbvo41wTmyXE9nEDcxgrt01tVPMUrEMO7nJCjC2AeSHxMRjoO4dm7cc0XdvTCpSRD9zDLlSTjuloYi0pw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.003111, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The block layer already validates proper block sizes with blk_validate_block_size() for us so we can remove this now superfluous check. Signed-off-by: Luis Chamberlain --- drivers/nvme/host/core.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 855b42c92284..86ff872cf6bd 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2022,16 +2022,6 @@ static bool nvme_update_disk_info(struct nvme_ns *ns, struct nvme_id_ns *id, u32 atomic_bs, phys_bs, io_opt = 0; bool valid = true; - /* - * The block layer can't support LBA sizes larger than the page size - * or smaller than a sector size yet, so catch this early and don't - * allow block I/O. - */ - if (head->lba_shift > PAGE_SHIFT || head->lba_shift < SECTOR_SHIFT) { - bs = (1 << 9); - valid = false; - } - atomic_bs = phys_bs = bs; if (id->nabo == 0) { /*