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: <ZrK5Lu1+oqqyG3ke@dread.disaster.area>
Date: Wed, 7 Aug 2024 10:00:46 +1000
From: Dave Chinner <david@...morbit.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: John Garry <john.g.garry@...cle.com>, chandan.babu@...cle.com,
	dchinner@...hat.com, hch@....de, 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 v3 04/14] xfs: make EOF allocation simpler

On Tue, Aug 06, 2024 at 11:58:53AM -0700, Darrick J. Wong wrote:
> On Thu, Aug 01, 2024 at 04:30:47PM +0000, John Garry wrote:
> > @@ -3688,12 +3649,19 @@ xfs_bmap_btalloc_filestreams(
> >  	}
> >  
> >  	args->minlen = xfs_bmap_select_minlen(ap, args, blen);
> > -	if (ap->aeof)
> > -		error = xfs_bmap_btalloc_at_eof(ap, args, blen, true);
> > +	if (ap->aeof && ap->offset)
> > +		error = xfs_bmap_btalloc_at_eof(ap, args);
> >  
> > +	/* This may be an aligned allocation attempt. */
> >  	if (!error && args->fsbno == NULLFSBLOCK)
> >  		error = xfs_alloc_vextent_near_bno(args, ap->blkno);
> >  
> > +	/* Attempt non-aligned allocation if we haven't already. */
> > +	if (!error && args->fsbno == NULLFSBLOCK && args->alignment > 1)  {
> > +		args->alignment = 1;
> > +		error = xfs_alloc_vextent_near_bno(args, ap->blkno);
> 
> Oops, I just replied to the v2 thread instead of this.
> 
> From
> https://lore.kernel.org/linux-xfs/20240621203556.GU3058325@frogsfrogsfrogs/
> 
> Do we have to zero args->alignslop here?

No. It should always be zero here to begin with. It is the
responsibility of the allocation attempt that modifies
args->alignment and args->alignslop to reset them to original values
on allocation failure.

The only places we use alignslop are xfs_bmap_btalloc_at_eof() and
xfs_ialloc_ag_alloc(). They both zero it and reset args->alignment
on allocation failure before falling through to the next allocation
attempt.

-Dave.
-- 
Dave Chinner
david@...morbit.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ