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: <20241212062641.GD6678@frogsfrogsfrogs>
Date: Wed, 11 Dec 2024 22:26:41 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Jens Axboe <axboe@...nel.dk>, linux-mm@...ck.org,
	linux-fsdevel@...r.kernel.org, hannes@...xchg.org, clm@...a.com,
	linux-kernel@...r.kernel.org, willy@...radead.org,
	kirill@...temov.name, linux-btrfs@...r.kernel.org,
	linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
	bfoster@...hat.com
Subject: Re: [PATCH 14/17] iomap: make buffered writes work with RWF_UNCACHED

On Wed, Dec 11, 2024 at 09:50:19PM -0800, Christoph Hellwig wrote:
> On Thu, Nov 14, 2024 at 08:25:18AM -0700, Jens Axboe wrote:
> > +	if (iocb->ki_flags & IOCB_UNCACHED)
> > +		iter.flags |= IOMAP_UNCACHED;
> >  
> > -	while ((ret = iomap_iter(&iter, ops)) > 0)
> > +	while ((ret = iomap_iter(&iter, ops)) > 0) {
> > +		if (iocb->ki_flags & IOCB_UNCACHED)
> > +			iter.iomap.flags |= IOMAP_F_UNCACHED;
> 
> iomap.flags and the IOMAP_F_* namespace is used to communicate flags
> from the file system to the iomap core, so this looks wrong.

Not entirely true -- IOMAP_F_SIZE_CHANGED is used to communicate state
from iomap to gfs2, and IOMAP_F_STALE is set/checked only by the iomap
core.  iomap.h even says as much.

Though given that there's a 4-byte gap in struct iomap between flags and
the bdev pointer (at least on 64-bit) maybe we should make a separate
field for these iomap state bits?

> >  	size_t poff = offset_in_folio(folio, pos);
> >  	int error;
> >  
> > +	if (folio_test_uncached(folio))
> > +		wpc->iomap.flags |= IOMAP_F_UNCACHED;
> 
> I guess this is what actually makes it work.  Note that with the iomap
> zoned series I posted yesteday things change a bit here in that the flags
> in the wpc are decouple from the iomap flags, and this would now become
> a wpc only flag as it isn't really a fs to iomap cummunication, but
> based on iomap / page cache state.

Hrmmm I'll go take a second look at that patch in the morning in case a
better idea comes along.

--D

Powered by blists - more mailing lists