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: <20250423145850.GA25675@frogsfrogsfrogs>
Date: Wed, 23 Apr 2025 07:58:50 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: Christoph Hellwig <hch@....de>
Cc: John Garry <john.g.garry@...cle.com>, brauner@...nel.org,
	viro@...iv.linux.org.uk, jack@...e.cz, cem@...nel.org,
	linux-fsdevel@...r.kernel.org, dchinner@...hat.com,
	linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	ojaswin@...ux.ibm.com, ritesh.list@...il.com,
	martin.petersen@...cle.com, linux-ext4@...r.kernel.org,
	linux-block@...r.kernel.org, catherine.hoang@...cle.com,
	linux-api@...r.kernel.org
Subject: Re: [PATCH v8 11/15] xfs: commit CoW-based atomic writes atomically

On Wed, Apr 23, 2025 at 10:23:07AM +0200, Christoph Hellwig wrote:
> On Tue, Apr 22, 2025 at 12:27:35PM +0000, John Garry wrote:
> > +STATIC void
> 
> Didn't we phase out STATIC for new code?
> 
> > +xfs_calc_default_atomic_ioend_reservation(
> > +	struct xfs_mount	*mp,
> > +	struct xfs_trans_resv	*resp)
> > +{
> > +	if (xfs_has_reflink(mp))
> > +		resp->tr_atomic_ioend = resp->tr_itruncate;
> > +	else
> > +		memset(&resp->tr_atomic_ioend, 0,
> > +				sizeof(resp->tr_atomic_ioend));
> > +}
> 
> What is the point of zeroing out the structure for the non-reflink
> case?  Just as a poision for not using it when not supported as no
> code should be doing that?  Just thinking of this because it is a
> potentially nasty landmine for the zoned atomic support.

Yes.  I thought about adding a really stupid helper:

static inline bool xfs_has_sw_atomic_write(struct xfs_mount *mp)
{
	return xfs_has_reflink(mp);
}

But that seemed too stupid so I left it out.  Maybe it wasn't so dumb,
since that would be where you'd enable ZNS support by changing that to:

	return xfs_has_reflink(mp) || xfs_has_zoned(mp);

--D

> Otherwise looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@....de>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ