On Thu, Dec 12, 2024 at 11:56:24AM -0800, Darrick J. Wong wrote: > > return 0; > > + if (ioend->io_flags & IOMAP_IOEND_DIRECT) > > + return iomap_finish_ioend_direct(ioend); > > return iomap_finish_ioend_buffered(ioend); > > } > > I'm a little surprised that more of the iomap_ioend* functions didn't > end up in ioend.c. See the cover letter. For development I wanted to avoid churn. Once we have general approval for the concept I'd like to move more code. > > + WRITE_ONCE(dio->submit.waiter, NULL); > > + blk_wake_io_task(waiter); > > + } else if (!inode->i_mapping->nrpages) { > > + WRITE_ONCE(iocb->private, NULL); > > + > > + /* > > + * We must never invalidate pages from this thread to > > + * avoid deadlocks with buffered I/O completions. > > + * Tough luck if you hit the tiny race with someone > > + * dirtying the range now. > > What happens, exactly? Does that mean that the dirty pagecache always > survives? Yes.