Skip to content

Commit 4935b16

Browse files
Jaegeuk Kimpundiramit
authored andcommitted
f2fs: fix wrong AUTO_RECOVER condition
commit 97dd26ad834739d4e4ea35fd7ab5f92824de4cbb upstream. If i_size is not aligned to the f2fs's block size, we should not skip inode update during fsync. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 65bdf69 commit 4935b16

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/f2fs/f2fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,8 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
17741774
spin_unlock(&sbi->inode_lock[DIRTY_META]);
17751775
return ret;
17761776
}
1777-
if (!is_inode_flag_set(inode, FI_AUTO_RECOVER))
1777+
if (!is_inode_flag_set(inode, FI_AUTO_RECOVER) ||
1778+
i_size_read(inode) & PAGE_MASK)
17781779
return false;
17791780
return F2FS_I(inode)->last_disk_size == i_size_read(inode);
17801781
}

0 commit comments

Comments
 (0)