aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 9160a37e1c7a..41afb9534bbd 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -346,6 +346,10 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
346 if (IS_INODE(page)) { 346 if (IS_INODE(page)) {
347 recover_inline_xattr(inode, page); 347 recover_inline_xattr(inode, page);
348 } else if (f2fs_has_xattr_block(ofs_of_node(page))) { 348 } else if (f2fs_has_xattr_block(ofs_of_node(page))) {
349 /*
350 * Deprecated; xattr blocks should be found from cold log.
351 * But, we should remain this for backward compatibility.
352 */
349 recover_xattr_data(inode, page, blkaddr); 353 recover_xattr_data(inode, page, blkaddr);
350 goto out; 354 goto out;
351 } 355 }
@@ -396,7 +400,8 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
396 400
397 /* write dummy data page */ 401 /* write dummy data page */
398 recover_data_page(sbi, NULL, &sum, src, dest); 402 recover_data_page(sbi, NULL, &sum, src, dest);
399 update_extent_cache(dest, &dn); 403 dn.data_blkaddr = dest;
404 update_extent_cache(&dn);
400 recovered++; 405 recovered++;
401 } 406 }
402 dn.ofs_in_node++; 407 dn.ofs_in_node++;
@@ -503,7 +508,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
503 INIT_LIST_HEAD(&inode_list); 508 INIT_LIST_HEAD(&inode_list);
504 509
505 /* step #1: find fsynced inode numbers */ 510 /* step #1: find fsynced inode numbers */
506 sbi->por_doing = true; 511 set_sbi_flag(sbi, SBI_POR_DOING);
507 512
508 /* prevent checkpoint */ 513 /* prevent checkpoint */
509 mutex_lock(&sbi->cp_mutex); 514 mutex_lock(&sbi->cp_mutex);
@@ -536,7 +541,7 @@ out:
536 truncate_inode_pages_final(META_MAPPING(sbi)); 541 truncate_inode_pages_final(META_MAPPING(sbi));
537 } 542 }
538 543
539 sbi->por_doing = false; 544 clear_sbi_flag(sbi, SBI_POR_DOING);
540 if (err) { 545 if (err) {
541 discard_next_dnode(sbi, blkaddr); 546 discard_next_dnode(sbi, blkaddr);
542 547