mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
f2fs: use i_size_read to get i_size
We need to use i_size_read() to get inode->i_size. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
8dc0d6a11e
commit
819d9153d4
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue