f2fs: avoid skipping recover_inline_xattr after recover_inline_data
authorChao Yu <chao2.yu@samsung.com>
Sat, 2 Aug 2014 07:26:04 +0000 (15:26 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 2 Aug 2014 14:43:51 +0000 (07:43 -0700)
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>
fs/f2fs/f2fs.h
fs/f2fs/node.c
fs/f2fs/recovery.c

index 99425675c2f858d59e98641a99164866cb391166..4dab5338a97af496ad6f5ee5867a6e6457a03ec5 100644 (file)
@@ -1204,6 +1204,7 @@ void alloc_nid_done(struct f2fs_sb_info *, nid_t);
 void alloc_nid_failed(struct f2fs_sb_info *, nid_t);
 void recover_node_page(struct f2fs_sb_info *, struct page *,
                struct f2fs_summary *, struct node_info *, block_t);
+void recover_inline_xattr(struct inode *, struct page *);
 bool recover_xattr_data(struct inode *, struct page *, block_t);
 int recover_inode_page(struct f2fs_sb_info *, struct page *);
 int restore_node_summary(struct f2fs_sb_info *, unsigned int,
index 7b5b5def65fe9a13451d0917b2820e0f61343c22..d3d90d2846313d546c1328145d48a2013645f3dd 100644 (file)
@@ -1549,7 +1549,7 @@ void recover_node_page(struct f2fs_sb_info *sbi, struct page *page,
        clear_node_page_dirty(page);
 }
 
-static void recover_inline_xattr(struct inode *inode, struct page *page)
+void recover_inline_xattr(struct inode *inode, struct page *page)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
        void *src_addr, *dst_addr;
@@ -1588,8 +1588,6 @@ bool recover_xattr_data(struct inode *inode, struct page *page, block_t blkaddr)
        nid_t new_xnid = nid_of_node(page);
        struct node_info ni;
 
-       recover_inline_xattr(inode, page);
-
        if (!f2fs_has_xattr_block(ofs_of_node(page)))
                return false;
 
index b2aa53b99f64650975b680619761237543c3d6d3..fe1c6d921ba2fb535464d031d5822877e6eeccbd 100644 (file)
@@ -300,6 +300,8 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
        struct node_info ni;
        int err = 0, recovered = 0;
 
+       recover_inline_xattr(inode, page);
+
        if (recover_inline_data(inode, page))
                goto out;
 
This page took 0.04664 seconds and 5 git commands to generate.