Skip to content

Commit 1eca05a

Browse files
Yunlei HeJaegeuk Kim
authored andcommitted
f2fs: update inode info to inode page for new file
After checkpoint, 1. creat a new file A ,(with dirty inode && dirty inode page && xattr info) 2. backgroud wb write back file A inode page (without update from inode cache) 3. fsync file A, write back inode page of file A with inode cache info 4. sudden power off before new checkpoint In this case, recovery process will try to recover a zero inode page. Inline xattr flag of file A will be miss and xattr info will be taken as blkaddr index. Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent f66c027 commit 1eca05a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/f2fs/node.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,9 @@ void recover_inline_xattr(struct inode *inode, struct page *page)
22072207
f2fs_bug_on(F2FS_I_SB(inode), IS_ERR(ipage));
22082208

22092209
ri = F2FS_INODE(page);
2210-
if (!(ri->i_inline & F2FS_INLINE_XATTR)) {
2210+
if (ri->i_inline & F2FS_INLINE_XATTR) {
2211+
set_inode_flag(inode, FI_INLINE_XATTR);
2212+
} else {
22112213
clear_inode_flag(inode, FI_INLINE_XATTR);
22122214
goto update_inode;
22132215
}

0 commit comments

Comments
 (0)