On Tue, Jan 07, 2020 at 05:59:09AM -0600, Goldwyn Rodrigues wrote: > Testing revealed that removing check_direct_IO will not work. We try and > reserve space as a whole for the entire direct write. These checks > safeguard from requests unaligned to fs_info->sectorsize. Ok. The fact that a wrong sector size falls back to buffered I/O instead of failing the I/O is still bogus, though. Btrfs should align with all other file systems there. > > I liked the patch to split and fold the direct_IO code. However to merge > it into this will make it difficult to understand the changes since we > are moving it to a different file rather than changing in-place. A > separate patch would better serve as a cleanup. Sure, this can be added on top.