From: Luis Chamberlain <mcgrof@kernel.org>
To: hch@infradead.org, djwong@kernel.org, dchinner@redhat.com,
kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com
Cc: willy@infradead.org, brauner@kernel.org, hare@suse.de,
ritesh.list@gmail.com, rgoldwyn@suse.com, jack@suse.cz,
ziy@nvidia.com, ryan.roberts@arm.com, patches@lists.linux.dev,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-block@vger.kernel.org, p.raghav@samsung.com,
da.gomez@samsung.com, dan.helmick@samsung.com, mcgrof@kernel.org
Subject: [RFC v2 03/10] bdev: increase bdev max blocksize depending on the aops used
Date: Fri, 15 Sep 2023 14:32:47 -0700 [thread overview]
Message-ID: <20230915213254.2724586-4-mcgrof@kernel.org> (raw)
In-Reply-To: <20230915213254.2724586-1-mcgrof@kernel.org>
While buffer-heads is stuck at order 0, so PAGE_SIZE, iomap support is
currently capped at MAX_PAGECACHE_ORDER as that is the cap also set on
readahead. We match parity for the max allowed block size when using
iomap.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
block/bdev.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 63b4d7dd8075..0d685270cd34 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -143,10 +143,17 @@ static void set_init_blocksize(struct block_device *bdev)
}
}
+static int bdev_bsize_limit(struct block_device *bdev)
+{
+ if (bdev->bd_inode->i_data.a_ops == &def_blk_aops_iomap)
+ return 1 << (PAGE_SHIFT + MAX_PAGECACHE_ORDER);
+ return PAGE_SIZE;
+}
+
int set_blocksize(struct block_device *bdev, int size)
{
- /* Size must be a power of two, and between 512 and PAGE_SIZE */
- if (size > PAGE_SIZE || size < 512 || !is_power_of_2(size))
+ /* Size must be a power of two, and between 512 and supported order */
+ if (size > bdev_bsize_limit(bdev) || size < 512 || !is_power_of_2(size))
return -EINVAL;
/* Size cannot be smaller than the size supported by the device */
--
2.39.2
next prev parent reply other threads:[~2023-09-15 21:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 21:32 [RFC v2 00/10] bdev: LBS devices support to coexist with buffer-heads Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 01/10] bdev: rename iomap aops Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 02/10] bdev: dynamically set aops to enable LBS support Luis Chamberlain
2023-09-15 21:32 ` Luis Chamberlain [this message]
2023-09-15 21:32 ` [RFC v2 04/10] filesystems: add filesytem buffer-head flag Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 05/10] bdev: allow to switch between bdev aops Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 06/10] bdev: simplify coexistance Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 07/10] nvme: enhance max supported LBA format check Luis Chamberlain
2023-09-15 22:20 ` Matthew Wilcox
2023-09-15 22:27 ` Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 08/10] nvme: add awun / nawun sanity check Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 09/10] nvme: add nvme_core.debug_large_atomics to force high awun as phys_bs Luis Chamberlain
2023-09-15 21:32 ` [RFC v2 10/10] nvme: enable LBS support Luis Chamberlain
2023-09-15 21:51 ` [RFC v2 00/10] bdev: LBS devices support to coexist with buffer-heads Matthew Wilcox
2023-09-15 22:26 ` Luis Chamberlain
2023-09-17 11:50 ` Hannes Reinecke
2023-09-18 17:12 ` Luis Chamberlain
2023-09-18 18:15 ` Matthew Wilcox
2023-09-18 18:42 ` Hannes Reinecke
2023-09-17 22:38 ` Dave Chinner
2023-09-17 23:14 ` Matthew Wilcox
2023-09-18 0:59 ` Dave Chinner
2023-09-18 1:13 ` Luis Chamberlain
2023-09-18 2:49 ` Dave Chinner
2023-09-18 17:51 ` Luis Chamberlain
2023-09-18 11:34 ` Hannes Reinecke
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=20230915213254.2724586-4-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=axboe@fb.com \
--cc=brauner@kernel.org \
--cc=da.gomez@samsung.com \
--cc=dan.helmick@samsung.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=p.raghav@samsung.com \
--cc=patches@lists.linux.dev \
--cc=rgoldwyn@suse.com \
--cc=ritesh.list@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=sagi@grimberg.me \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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 NNTP newsgroup(s).