Re: [PATCH 06/21] btrfs: wait ordered range before locking during truncate

Christoph Hellwig
2023-03-07T17:10:15Z

So, one thing I've been wondering about for a while is why btrfs even
does all these explicit waits for ordered extents. The ordered_extent
is effectively a mechanism to describe a range of I/O.

So why can't we use the nornal mechanisms to wait for I/O, that is the
completion of writeback for buffered I/O (i.e. filemap_fdatawait*)
and inode_dio_wait for direct I/O? I've been wanting to look deeper
into this for a while, so this might be a good time to bring it up.