Browse Source

f2fs: should clear the inline_xattr flag

During the recovery, we should clear the inline_xattr flag if its xattr node
block is recovered.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim 11 years ago
parent
commit
e3b4d43f7c
1 changed files with 7 additions and 8 deletions
  1. 7 8
      fs/f2fs/node.c

+ 7 - 8
fs/f2fs/node.c

@@ -1557,26 +1557,25 @@ void recover_inline_xattr(struct inode *inode, struct page *page)
 	struct page *ipage;
 	struct page *ipage;
 	struct f2fs_inode *ri;
 	struct f2fs_inode *ri;
 
 
-	if (!f2fs_has_inline_xattr(inode))
-		return;
-
 	if (!IS_INODE(page))
 	if (!IS_INODE(page))
 		return;
 		return;
 
 
-	ri = F2FS_INODE(page);
-	if (!(ri->i_inline & F2FS_INLINE_XATTR))
-		return;
-
 	ipage = get_node_page(sbi, inode->i_ino);
 	ipage = get_node_page(sbi, inode->i_ino);
 	f2fs_bug_on(IS_ERR(ipage));
 	f2fs_bug_on(IS_ERR(ipage));
 
 
+	ri = F2FS_INODE(page);
+	if (!(ri->i_inline & F2FS_INLINE_XATTR)) {
+		clear_inode_flag(F2FS_I(inode), FI_INLINE_XATTR);
+		goto update_inode;
+	}
+
 	dst_addr = inline_xattr_addr(ipage);
 	dst_addr = inline_xattr_addr(ipage);
 	src_addr = inline_xattr_addr(page);
 	src_addr = inline_xattr_addr(page);
 	inline_size = inline_xattr_size(inode);
 	inline_size = inline_xattr_size(inode);
 
 
 	f2fs_wait_on_page_writeback(ipage, NODE);
 	f2fs_wait_on_page_writeback(ipage, NODE);
 	memcpy(dst_addr, src_addr, inline_size);
 	memcpy(dst_addr, src_addr, inline_size);
-
+update_inode:
 	update_inode(inode, ipage);
 	update_inode(inode, ipage);
 	f2fs_put_page(ipage, 1);
 	f2fs_put_page(ipage, 1);
 }
 }