On 2020/6/6 上午4:48, Goldwyn Rodrigues wrote: > In current scenarios, for XFS, it would mean that a page invalidation > would end up being a writeback error. So, if iomap returns zero, fall > back to biffered I/O. XFS has never supported fallback to buffered I/O. > I hope it is not "never will" ;) > > With mixed buffered and direct writes in btrfs, the pages may not be > released the extent may be locked in the ordered extents cleanup thread, I'm wondering can we handle this case in a different way. In fact btrfs has its own special handling for invalidating pages. Btrfs will first look for any ordered extents covering the page, finish the ordered extent manually, then invalidate the page. I'm not sure why invalidate_inode_pages2_range() used in dio iomap code does not use the fs specific invalidatepage(), but only do_lander_page() then releasepage(). Shouldn'y we btrfs implement the lander_page() to handle ordered extents properly? Or is there any special requirement? Thanks, Qu > which must make changes to the btrfs trees. In case of btrfs, if it is > possible to wait, depending on the memory flags passed, wait for extent > bit to be cleared so direct I/O is executed so there is no need to > fallback to buffered I/O. >
Attachment:
signature.asc
Description: OpenPGP digital signature