|
@@ -800,12 +800,17 @@ 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, iov,
|
|
|
offset, nr_segs, ext4_get_block);
|
|
|
|