From patchwork Sat Dec 14 03:10:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13908282 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 A1E18E77180 for ; Sat, 14 Dec 2024 03:11:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904FA6B009D; Fri, 13 Dec 2024 22:11:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 83CA96B009B; Fri, 13 Dec 2024 22:11:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 186026B0093; Fri, 13 Dec 2024 22:11:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 596E16B0092 for ; Fri, 13 Dec 2024 22:11:02 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 14D9FB0484 for ; Sat, 14 Dec 2024 03:11:02 +0000 (UTC) X-FDA: 82892087082.21.E1EE563 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP id 65B041C000C for ; Sat, 14 Dec 2024 03:10:48 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1EBbiPVm; spf=none (imf18.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734145848; 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=SC13mhGE1TKS2Lk87NYZVfEBxxs49zvhyYsSfa79OZk=; b=CrzkNHWXBND718zWVuufoLFOL2Y9DQ9CUzO157uFSMFhJdkMW2K6BBesnR5W3cv5/3RuwK Ytld1PKYpS2uVtrGUhiTJYwL8U8hdOjdeg7+U9I2qhsoCDfLLxcP6i8A5PZyLp41EtCWtq cxunspH3rcyg+l1rJV6AkPH9zmbsI34= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1EBbiPVm; spf=none (imf18.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734145848; a=rsa-sha256; cv=none; b=gemD6kPmNIlBoidYjjhOEQ8Ll6WTgpwf+79W3ywnX8r4LXxUyGvMgFQMTxn2FRk0CdAtme xkDzUWaQdxRtsL1pb7l2dZKX24MhiXEp7li5KvBYlntA2bnGMfFnOiiYaLPKVeAl/9EINM yN+Z+1fNp4PpU7tGiePAj4k203Kwi8k= 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=SC13mhGE1TKS2Lk87NYZVfEBxxs49zvhyYsSfa79OZk=; b=1EBbiPVmmO/i62EdqjkG8nBcyi k/algK3tiiXr1Br1Uk9Qt9p/uY5q0O43rcQZuE5e6kuBKV2SWOEt/KqsMaIQY8aN1wO/D2NHKMlEJ 2+BNxHzVQUme6o6AFjNh5P1B87JL3yLWk9CzE9EYwujJ7MO+6hQx0giICBsCV8eymOQsYUKIy/d8m NYsfTm4ZQ1Hs/vrfv18SZK9QPKW+R5YpL1pEDfUKo1BRlZUL1vdwtlvgETaVFB4OUYozDByc6viYJ Q+1N9a4ZD2iUqPcfZdrG2s1dHK9WAdLBpCkOVJcGl4BLCn+tts5iT/ZXrC6R+O9AOQrOKZ7DuAaKS rE/RqCUw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tMIYO-00000005c3r-0E3S; Sat, 14 Dec 2024 03:10:52 +0000 From: Luis Chamberlain To: willy@infradead.org, hch@lst.de, hare@suse.de, dave@stgolabs.net, 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 v2 10/11] nvme: remove superfluous block size check Date: Fri, 13 Dec 2024 19:10:48 -0800 Message-ID: <20241214031050.1337920-11-mcgrof@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241214031050.1337920-1-mcgrof@kernel.org> References: <20241214031050.1337920-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 65B041C000C X-Stat-Signature: 61r5omj9aecoahc79dgjou5qymeutbpw X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspam: Yes X-HE-Tag: 1734145848-809474 X-HE-Meta: U2FsdGVkX1+8BKUx/s4eQ8MPdMRKRCZrUM6WjlhVsy2P4yDWEP4mrtXHbGb1SgYZtkKSiW/MhUBop5FXreP50yvYf45xGI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J6CdIPyiy3jj9dU3i4JGfA6B2BQ0eEmm7HWl9yosyZn0lWMNWp5RGoooQmwzxbR6AKnzEGU8RmP2APOa2AfNmHf53HCkHz9Y96bNGgtJZHmNs5dqrKYN9dfDORHkBdTkl+SQjJwiG1kdpt6WEhVnbOOBBNL7RPEi2+5QVig818TsuuGc0CUTaKB4hd9H3HfpUvXTL0LI7VlgOHD90DcbtZAa7PvV2k1IuCO8+sCdsjwcGM8M2RrDyd6fFAeFKeiNoNw2tzYVrH6MN7c7DYsqntx8vmJpY7jYajeiI5yocq1GnIOK9Nndww== X-Bogosity: Ham, tests=bogofilter, spamicity=0.006238, 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. Reviewed-by: Hannes Reinecke 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 d169a30eb935..bbb5e9d2415c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2029,16 +2029,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) { /*