diff options
-rw-r--r-- | fs/ext4/inode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index af09060..792e6a9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3510,12 +3510,17 @@ static ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, } retry: - if (rw == READ && ext4_should_dioread_nolock(inode)) + if (rw == READ && ext4_should_dioread_nolock(inode)) { + if (unlikely(!list_empty(&ei->i_completed_io_list))) { + mutex_lock(&inode->i_mutex); + ext4_flush_completed_IO(inode); + mutex_unlock(&inode->i_mutex); + } ret = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, offset, nr_segs, ext4_get_block, NULL, NULL, 0); - else { + } else { ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, offset, nr_segs, |