lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZpayAGWQdw1rbCng@casper.infradead.org>
Date: Tue, 16 Jul 2024 18:46:40 +0100
From: Matthew Wilcox <willy@...radead.org>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>,
	david@...morbit.com, chandan.babu@...cle.com, brauner@...nel.org,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	yang@...amperecomputing.com, linux-mm@...ck.org,
	john.g.garry@...cle.com, linux-fsdevel@...r.kernel.org,
	hare@...e.de, p.raghav@...sung.com, mcgrof@...nel.org,
	gost.dev@...sung.com, cl@...amperecomputing.com,
	linux-xfs@...r.kernel.org, ryan.roberts@....com, hch@....de,
	Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH v10 10/10] xfs: enable block size larger than page size
 support

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ