Skip to content

Commit

Permalink
f2fs: use i_size_read to get i_size
Browse files Browse the repository at this point in the history
We need to use i_size_read() to get inode->i_size.

Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
Jaegeuk Kim committed Dec 30, 2015
1 parent 8dc0d6a commit 819d915
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 819d915

Please sign in to comment.