Re: [PATCH v2] generic: add test for direct io partial writes

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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>



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux