On Thu, 23 Feb 2023 10:01:51 -0800, Boris Burkov wrote: > btrfs recently had a bug where a direct io partial write resulted in a > hole in the file. Add a new generic test which creates a 2MiB file, > mmaps it, touches the first byte, then does an O_DIRECT write of the > mmapped buffer into a new file. This should result in the mapped pages > being a mix of in and out of page cache and thus a partial write, for > filesystems using iomap and IOMAP_DIO_PARTIAL. > > Signed-off-by: Boris Burkov <boris@xxxxxx> > --- > Changelog: > v2: > - hide fd in prep_mmap_buffer, we weren't closing it in main > - get rid of unneeded filters/cleanup in test script > - make pwrite pattern explicit > - send random mmapped char to /dev/null > - gate _fixed_by_kernel_commit by FSTYP > - remove extra sync after writing file > - use $seq in test filenames Reviewed-by: David Disseldorp <ddiss@xxxxxxx>