diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 6fbfc70ac8a03f4b3a6ab1844331215d38982850..14b40a9db5b39adb0929bdba3d7ccac1b6a16e9b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1386,10 +1386,11 @@ static int f2fs_write_data_pages(struct address_space *mapping, 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); } }