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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250501162216.GB25675@frogsfrogsfrogs>
Date: Thu, 1 May 2025 09:22:16 -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 v9 05/15] xfs: ignore HW which cannot atomic write a
 single block

On Wed, Apr 30, 2025 at 02:59:06PM +0200, Christoph Hellwig wrote:
> On Tue, Apr 29, 2025 at 07:44:46AM -0700, Darrick J. Wong wrote:
> > > So this can't be merged into xfs_setsize_buftarg as suggeted last round
> > > instead of needing yet another per-device call into the buftarg code?
> > 
> > Oh, heh, I forgot that xfs_setsize_buftarg is called a second time by
> > xfs_setup_devices at the end of fill_super.
> 
> That's actually the real call.  The first is just a dummy to have
> bt_meta_sectorsize/bt_meta_sectormask initialized because if we didn't
> do that some assert in the block layer triggered.  We should probably
> remove that call and open code the two assignments..
> 
> > I don't like the idea of merging the hw atomic write detection into
> > xfs_setsize_buftarg itself because (a) it gets called for the data
> > device before we've read the fs blocksize so the validation is
> > meaningless and (b) that makes xfs_setsize_buftarg's purpose less
> > cohesive.
> 
> As explained last round this came up I'd of course rename it if
> we did that.  But I can do that later.

<nod> Would you be willing to review this patch as it is now and either
you or me can just tack a new cleanup patch on the end?  I tried writing
a patch to clean this up, but ran into questions:

At first I thought that the xfs_setsize_buftarg call in
xfs_alloc_buftarg could be replaced by open-coding the bt_meta_sector*
assignment, checking that bdev_validate_blocksize is ok, and dropping
the sync_blockdev.

Once we get to xfs_setup_devices, we can call xfs_setsize_buftarg on the
three buftargs, and xfs_setsize_buftarg will configure the atomic writes
geometry.

But then as I was reading the patch, it occurred to me that at least for
the data device, we actually /do/ want that sync_blockdev call so that
any dirty pagecache for the superblock actually get written to disk.
Maybe that can go at the end of xfs_open_devices?  But would it be
preferable to sync all the devices prior to trying to read the primary
sb?  I don't think there's a need, but maybe someone else has a
different viewpoint?

--D

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ