This reverts commit e5465795cac4 ("ext4: fix off-by-one error when writing back pages before dio read"). It is related to the following revert 16c54688592c ("ext4: Allow parallel DIO reads") which causes significant performance regression in mixed random read/write scenario. Signed-off-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0f505f0..16077ec 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3875,7 +3875,7 @@ static ssize_t ext4_direct_IO_read(struct kiocb *iocb, struct iov_iter *iter) */ inode_lock_shared(inode); ret = filemap_write_and_wait_range(mapping, iocb->ki_pos, - iocb->ki_pos + count - 1); + iocb->ki_pos + count); if (ret) goto out_unlock; ret = __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev, -- 1.8.3.1