diff options
| author | Keith Busch <kbusch@kernel.org> | 2025-08-27 07:12:55 -0700 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-09-09 10:27:01 -0600 |
| commit | 7eac331869575d81eaa2dd68b19e7468f8fa93cb (patch) | |
| tree | 01128b3a511391570a2967610a321ca0195bf769 /fs/iomap | |
| parent | 5ff3f74e145adc79b49668adb8de276446acf6be (diff) | |
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>
Diffstat (limited to 'fs/iomap')
| -rw-r--r-- | fs/iomap/direct-io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index fea23fa6a402..c06e41fd4d0a 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -337,8 +337,7 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio) u64 copied = 0; size_t orig_count; - if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) || - !bdev_iter_is_aligned(iomap->bdev, dio->submit.iter)) + if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1)) return -EINVAL; if (dio->flags & IOMAP_DIO_WRITE) { |
