Re: [PATCH] loop: fix the the direct I/O support check when used on top of block devices

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

 



On Wed, Jan 17, 2024 at 06:59:01PM +0100, Christoph Hellwig wrote:
> __loop_update_dio only checks the alignment requirement for block backed
> file systems, but misses them for the case where the loop device is
> created directly on top of another block device.  Due to this creating
> a loop device with default option plus the direct I/O flag on a > 512 byte
> sector size file system will lead to incorrect I/O being submitted to the
> lower block device and a lot of error from the lock layer.  This can
> be seen with xfstests generic/563.
> 
> Fix the code in __loop_update_dio by factoring the alignment check into
> a helper, and calling that also for the struct block_device of a block
> device inode.
> 
> Also remove the TODO comment talking about dynamically switching between
> buffered and direct I/O, which is a would be a recipe for horrible
> performance and occasional data loss.
> 
> Fixes: 2e5ab5f379f9 ("block: loop: prepare for supporing direct IO")
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Looks one nice cleanup & fix:

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>


Thanks,
Ming





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux