Commit 70cfed88efa760fd165fc413cfd1801b5cc8acd2

Authored by Chao Yu
Committed by Jaegeuk Kim
1 parent 70407fad85

f2fs: avoid skipping recover_inline_xattr after recover_inline_data

When we recover data of inode in roll-forward procedure, and the inode has both
inline data and inline xattr. We may skip recovering inline xattr if we recover
inline data form node page first.
This patch will fix the problem that we lost inline xattr data in above
scenario.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Showing 3 changed files with 4 additions and 3 deletions Side-by-side Diff

... ... @@ -1204,6 +1204,7 @@
1204 1204 void alloc_nid_failed(struct f2fs_sb_info *, nid_t);
1205 1205 void recover_node_page(struct f2fs_sb_info *, struct page *,
1206 1206 struct f2fs_summary *, struct node_info *, block_t);
  1207 +void recover_inline_xattr(struct inode *, struct page *);
1207 1208 bool recover_xattr_data(struct inode *, struct page *, block_t);
1208 1209 int recover_inode_page(struct f2fs_sb_info *, struct page *);
1209 1210 int restore_node_summary(struct f2fs_sb_info *, unsigned int,
... ... @@ -1549,7 +1549,7 @@
1549 1549 clear_node_page_dirty(page);
1550 1550 }
1551 1551  
1552   -static void recover_inline_xattr(struct inode *inode, struct page *page)
  1552 +void recover_inline_xattr(struct inode *inode, struct page *page)
1553 1553 {
1554 1554 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
1555 1555 void *src_addr, *dst_addr;
... ... @@ -1587,8 +1587,6 @@
1587 1587 nid_t prev_xnid = F2FS_I(inode)->i_xattr_nid;
1588 1588 nid_t new_xnid = nid_of_node(page);
1589 1589 struct node_info ni;
1590   -
1591   - recover_inline_xattr(inode, page);
1592 1590  
1593 1591 if (!f2fs_has_xattr_block(ofs_of_node(page)))
1594 1592 return false;
... ... @@ -300,6 +300,8 @@
300 300 struct node_info ni;
301 301 int err = 0, recovered = 0;
302 302  
  303 + recover_inline_xattr(inode, page);
  304 +
303 305 if (recover_inline_data(inode, page))
304 306 goto out;
305 307