On Mon, Oct 16, 2023 at 06:10:19PM +0200, Christoph Hellwig wrote: > On Mon, Oct 16, 2023 at 08:48:27AM -0700, Darrick J. Wong wrote: > > Hmm. xfs_prepare_ioend converts unwritten cowfork extents to written > > prior to submit_bio. So I guess you'd have to trick writeback into > > issuing totally separate bios for the single mapping. > > Yes. Hitting IOEND_BATCH_SIZE seems like the least difficult one > to hit, but even that would require work. > > > Then you'd have > > to delay the bio for the higher offset part of the mapping while > > allowing the bio for the lower part to complete, at which point it would > > convey the entire mapping to the data fork. > > Shouldn't really matter which side is faster. > > > Then you'd have to convince > > the kernel to reread the contents from disk. I think that would be hard > > since the folios for the incomplete writeback are still uptodate and > > marked for writeback. directio will block trying to flush and > > invalidate the cache, and buffered io will read the pagecache. > > I don't think on a live kernel it is possible. But if one of the > two bios completed before the other one, and power failed just inbetween. Ooooh, yeah. That could happen if the ioend metadata update gets written to the log device and the system crashes before that other bio even gets a chance to execute. --D