diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 6e9017e6a8197..403e8033c974b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3463,6 +3463,9 @@ static int check_direct_IO(struct inode *inode, struct iov_iter *iter, unsigned long align = offset | iov_iter_alignment(iter); struct block_device *bdev = inode->i_sb->s_bdev; + if (iov_iter_rw(iter) == READ && offset >= i_size_read(inode)) + return 1; + if (align & blocksize_mask) { if (bdev) blkbits = blksize_bits(bdev_logical_block_size(bdev));