On Tue, Jun 10, 2025 at 08:55:10PM -0700, Christoph Hellwig wrote: > On Tue, Jun 10, 2025 at 07:55:52AM -0700, Darrick J. Wong wrote: > > Hrmm. On closer examination, at least for xfs we've taken i_rwsem and > > the invalidate_lock so I think it should be the case that you don't need > > to revalidate. I think the same locks are held for iomap_unshare_range > > (mentioned elsewhere in this thread) though it doesn't apply to regular > > pagecache writes. > > We should document these assumptions, preferable using (lockdep) > asserts. Agreed. I think most of iomap/buffered-io.c wants the caller to hold i_rwsem in shared mode for reads; i_rwsem in exclusive mode for writes; and the invalidate lock for page faults. The big exception iirc is iomap_zero_range where you need to hold i_rwsem and the mapping invalidate lock, right? --D