Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[firefly-linux-kernel-4.4.55.git] / fs / ext3 / inode.c
index f57c87b0cb8338479244529d60c5a72f29b9dd26..04da6acde85dfbcfb50d89302c3f975baab3c76d 100644 (file)
@@ -1876,9 +1876,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
        }
 
 retry:
-       ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
-                                offset, nr_segs,
-                                ext3_get_block, NULL);
+       ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
+                                ext3_get_block);
        /*
         * In case of error extending write may have instantiated a few
         * blocks outside i_size. Trim these off again.
@@ -3276,6 +3275,9 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
                ext3_journal_stop(handle);
        }
 
+       if (attr->ia_valid & ATTR_SIZE)
+               inode_dio_wait(inode);
+
        if (S_ISREG(inode->i_mode) &&
            attr->ia_valid & ATTR_SIZE && attr->ia_size < inode->i_size) {
                handle_t *handle;