ext4: use i_size_read in ext4_unaligned_aio()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 12 Apr 2014 16:45:25 +0000 (12:45 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 12 Apr 2014 16:45:25 +0000 (12:45 -0400)
We haven't taken i_mutex yet, so we need to use i_size_read().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
fs/ext4/file.c

index 6db7f7db7777dffc4e4e0d959bf295dc0a03a6d8..bc765591101a9dfdcf3b541f8d4e8f333ab854be 100644 (file)
@@ -82,7 +82,7 @@ ext4_unaligned_aio(struct inode *inode, const struct iovec *iov,
        size_t count = iov_length(iov, nr_segs);
        loff_t final_size = pos + count;
 
-       if (pos >= inode->i_size)
+       if (pos >= i_size_read(inode))
                return 0;
 
        if ((pos & blockmask) || (final_size & blockmask))