f2fs: use i_size_read to get i_size
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Dec 2015 21:48:11 +0000 (13:48 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 30 Dec 2015 18:14:19 +0000 (10:14 -0800)
We need to use i_size_read() to get inode->i_size.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 6fbfc70ac8a03f4b3a6ab1844331215d38982850..14b40a9db5b39adb0929bdba3d7ccac1b6a16e9b 100644 (file)
@@ -1386,10 +1386,11 @@ skip_write:
 static void f2fs_write_failed(struct address_space *mapping, loff_t to)
 {
        struct inode *inode = mapping->host;
+       loff_t i_size = i_size_read(inode);
 
-       if (to > inode->i_size) {
-               truncate_pagecache(inode, inode->i_size);
-               truncate_blocks(inode, inode->i_size, true);
+       if (to > i_size) {
+               truncate_pagecache(inode, i_size);
+               truncate_blocks(inode, i_size, true);
        }
 }