Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iomap: simplify direct io validity check

The block layer checks all the segments for validity later, so no need
for an early check. Just reduce it to a simple position and total length
check, and defer the more invasive segment checks to the block layer.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Keith Busch and committed by
Jens Axboe
7eac3318 5ff3f74e

+1 -2
+1 -2
fs/iomap/direct-io.c
··· 337 337 u64 copied = 0; 338 338 size_t orig_count; 339 339 340 - if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) || 341 - !bdev_iter_is_aligned(iomap->bdev, dio->submit.iter)) 340 + if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1)) 342 341 return -EINVAL; 343 342 344 343 if (dio->flags & IOMAP_DIO_WRITE) {