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: <20240709074147.GA21491@lst.de>
Date: Tue, 9 Jul 2024 09:41:47 +0200
From: Christoph Hellwig <hch@....de>
To: Dave Chinner <david@...morbit.com>
Cc: Christoph Hellwig <hch@....de>, John Garry <john.g.garry@...cle.com>,
	chandan.babu@...cle.com, djwong@...nel.org, dchinner@...hat.com,
	viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
	linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, catherine.hoang@...cle.com,
	martin.petersen@...cle.com
Subject: Re: [PATCH v2 08/13] xfs: Do not free EOF blocks for forcealign

On Mon, Jul 08, 2024 at 11:44:59AM +1000, Dave Chinner wrote:
> On Sat, Jul 06, 2024 at 09:56:09AM +0200, Christoph Hellwig wrote:
> > On Fri, Jul 05, 2024 at 04:24:45PM +0000, John Garry wrote:
> > > -	if (xfs_inode_has_bigrtalloc(ip))
> > > +
> > > +	/* Only try to free beyond the allocation unit that crosses EOF */
> > > +	if (xfs_inode_has_forcealign(ip))
> > > +		end_fsb = roundup_64(end_fsb, ip->i_extsize);
> > > +	else if (xfs_inode_has_bigrtalloc(ip))
> > >  		end_fsb = xfs_rtb_roundup_rtx(mp, end_fsb);
> > 
> > Shouldn't we have a common helper to align things the right way?
> 
> Yes, that's what I keep saying. The common way to do this is:
> 
> 	align = xfs_inode_alloc_unitsize(ip);
> 	if (align > mp->m_blocksize)
> 		end_fsb = roundup_64(end_fsb, align);
> 
> Wrapping that into a helper might be appropriate, though we'd need
> wrappers for aligning both the start (down) and end (up).

I think the above is already good enough.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ