diff --git a/fs/iomap.c b/fs/iomap.c index 141c3cd55a8b2d..0ca8b0fbbdadfe 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -911,6 +911,9 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, break; } pos += ret; + + if (iov_iter_rw(iter) == READ && pos >= dio->i_size) + break; } while ((count = iov_iter_count(iter)) > 0); blk_finish_plug(&plug);