From: Matthew Wilcox <willy@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com>,
david@fromorbit.com, chandan.babu@oracle.com, brauner@kernel.org,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
yang@os.amperecomputing.com, linux-mm@kvack.org,
john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org,
hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org,
gost.dev@samsung.com, cl@os.amperecomputing.com,
linux-xfs@vger.kernel.org, ryan.roberts@arm.com, hch@lst.de,
Zi Yan <ziy@nvidia.com>
Subject: Re: [PATCH v10 10/10] xfs: enable block size larger than page size support
Date: Tue, 16 Jul 2024 18:46:40 +0100 [thread overview]
Message-ID: <ZpayAGWQdw1rbCng@casper.infradead.org> (raw)
In-Reply-To: <20240716174016.GZ1998502@frogsfrogsfrogs>
On Tue, Jul 16, 2024 at 10:40:16AM -0700, Darrick J. Wong wrote:
> On Tue, Jul 16, 2024 at 04:29:05PM +0100, Matthew Wilcox wrote:
> > On Mon, Jul 15, 2024 at 11:44:57AM +0200, Pankaj Raghav (Samsung) wrote:
> > > +++ b/fs/xfs/xfs_super.c
> > > @@ -1638,16 +1638,30 @@ xfs_fs_fill_super(
> > > goto out_free_sb;
> > > }
> > >
> > > - /*
> > > - * Until this is fixed only page-sized or smaller data blocks work.
> > > - */
> > > if (mp->m_sb.sb_blocksize > PAGE_SIZE) {
> > > - xfs_warn(mp,
> > > - "File system with blocksize %d bytes. "
> > > - "Only pagesize (%ld) or less will currently work.",
> > > + size_t max_folio_size = mapping_max_folio_size_supported();
> > > +
> > > + if (!xfs_has_crc(mp)) {
> > > + xfs_warn(mp,
> > > +"V4 Filesystem with blocksize %d bytes. Only pagesize (%ld) or less is supported.",
> > > mp->m_sb.sb_blocksize, PAGE_SIZE);
> > > - error = -ENOSYS;
> > > - goto out_free_sb;
> > > + error = -ENOSYS;
> > > + goto out_free_sb;
> > > + }
> > > +
> > > + if (mp->m_sb.sb_blocksize > max_folio_size) {
> > > + xfs_warn(mp,
> > > +"block size (%u bytes) not supported; maximum folio size supported in "\
> > > +"the page cache is (%ld bytes). Check MAX_PAGECACHE_ORDER (%d)",
> > > + mp->m_sb.sb_blocksize, max_folio_size,
> > > + MAX_PAGECACHE_ORDER);
> >
> > Again, too much message. Way too much. We shouldn't even allow block
> > devices to be created if their block size is larger than the max supported
> > by the page cache.
>
> Filesystem blocksize != block device blocksize. xfs still needs this
> check because one can xfs_copy a 64k-fsblock xfs to a hdd with 512b
> sectors and try to mount that on x86.
>
> Assuming there /is/ some fs that allows 1G blocksize, you'd then really
> want a mount check that would prevent you from mounting that.
Absolutely, we need to have an fs blocksize check in the fs (if only
because fs fuzzers will put random values in fields and expect the system
to not crash). But that should have nothing to do with page cache size.
next prev parent reply other threads:[~2024-07-16 17:46 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 9:44 [PATCH v10 00/10] enable bs > ps in XFS Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 01/10] fs: Allow fine-grained control of folio sizes Pankaj Raghav (Samsung)
2024-07-16 15:26 ` Matthew Wilcox
2024-07-17 9:46 ` Pankaj Raghav (Samsung)
2024-07-17 9:59 ` Ryan Roberts
2024-07-17 15:12 ` Pankaj Raghav (Samsung)
2024-07-17 15:25 ` Darrick J. Wong
2024-07-17 15:26 ` Ryan Roberts
2024-07-22 14:19 ` Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 02/10] filemap: allocate mapping_min_order folios in the page cache Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 03/10] readahead: allocate folios with mapping_min_order in readahead Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 04/10] mm: split a folio in minimum folio order chunks Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 05/10] filemap: cap PTE range to be created to allowed zero fill in folio_map_range() Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 06/10] iomap: fix iomap_dio_zero() for fs bs > system page size Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 07/10] xfs: use kvmalloc for xattr buffers Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 08/10] xfs: expose block size in stat Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 09/10] xfs: make the calculation generic in xfs_sb_validate_fsb_count() Pankaj Raghav (Samsung)
2024-07-15 9:44 ` [PATCH v10 10/10] xfs: enable block size larger than page size support Pankaj Raghav (Samsung)
2024-07-15 16:46 ` Darrick J. Wong
2024-07-22 14:12 ` Pankaj Raghav (Samsung)
2024-07-22 18:49 ` Darrick J. Wong
2024-07-16 15:29 ` Matthew Wilcox
2024-07-16 17:40 ` Darrick J. Wong
2024-07-16 17:46 ` Matthew Wilcox [this message]
2024-07-16 22:37 ` Darrick J. Wong
2024-07-17 10:02 ` Pankaj Raghav (Samsung)
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=ZpayAGWQdw1rbCng@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=cl@os.amperecomputing.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=gost.dev@samsung.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=john.g.garry@oracle.com \
--cc=kernel@pankajraghav.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=p.raghav@samsung.com \
--cc=ryan.roberts@arm.com \
--cc=yang@os.amperecomputing.com \
--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).