Linux-NVME Archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Matthew Wilcox <willy@infradead.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Pankaj Raghav <p.raghav@samsung.com>,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	Hannes Reinecke <hare@kernel.org>
Subject: [PATCH 6/6] nvme: enable logical block size > PAGE_SIZE
Date: Tue, 14 May 2024 19:39:00 +0200	[thread overview]
Message-ID: <20240514173900.62207-7-hare@kernel.org> (raw)
In-Reply-To: <20240514173900.62207-1-hare@kernel.org>

From: Pankaj Raghav <p.raghav@samsung.com>

Don't set the capacity to zero for when logical block size > PAGE_SIZE
as the block device with iomap aops support allocating block cache with
a minimum folio order.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 drivers/nvme/host/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 828c77fa13b7..111bf4197052 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1963,11 +1963,11 @@ static bool nvme_update_disk_info(struct nvme_ns *ns, struct nvme_id_ns *id,
 	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.
+	 * The block layer can't support LBA sizes larger than
+	 * MAX_PAGECACHE_ORDER or smaller than a sector size, so catch this
+	 * early and don't allow block I/O.
 	 */
-	if (head->lba_shift > PAGE_SHIFT || head->lba_shift < SECTOR_SHIFT) {
+	if (get_order(bs) > MAX_PAGECACHE_ORDER || head->lba_shift < SECTOR_SHIFT) {
 		bs = (1 << 9);
 		valid = false;
 	}
-- 
2.35.3



      parent reply	other threads:[~2024-05-14 17:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 17:38 [PATCHv2 0/6] enable bs > ps for block devices Hannes Reinecke
2024-05-14 17:38 ` [PATCH 1/6] fs/mpage: avoid negative shift for large blocksize Hannes Reinecke
2024-05-14 17:38 ` [PATCH 2/6] fs/mpage: use blocks_per_folio instead of blocks_per_page Hannes Reinecke
2024-05-14 17:38 ` [PATCH 3/6] blk-merge: split bio by max_segment_size, not PAGE_SIZE Hannes Reinecke
2024-05-15  0:20   ` John Garry
2024-05-15 12:29     ` Hannes Reinecke
2024-05-15 12:32       ` Hannes Reinecke
2024-05-15 15:21       ` John Garry
2024-05-14 17:38 ` [PATCH 4/6] block/bdev: enable large folio support for large logical block sizes Hannes Reinecke
2024-05-15  4:21   ` kernel test robot
2024-05-14 17:38 ` [PATCH 5/6] block/bdev: lift restrictions on supported blocksize Hannes Reinecke
2024-05-15  1:03   ` kernel test robot
2024-05-15  4:00   ` kernel test robot
2024-05-14 17:39 ` Hannes Reinecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240514173900.62207-7-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).