f2fs: fix por_doing variable coverage
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 15 May 2013 07:12:18 +0000 (16:12 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 28 May 2013 06:03:01 +0000 (15:03 +0900)
The reason of using sbi->por_doing is to alleviate data writes during the
recovery.
The find_fsync_dnodes() produces some dirty dentry pages, so we should
cover it too with sbi->por_doing.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/recovery.c

index 294198775f8b98cd699883a99c70318d968d3bec..4d895149a6f05886d176d54223eeb071c72e8525 100644 (file)
@@ -381,6 +381,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
        INIT_LIST_HEAD(&inode_list);
 
        /* step #1: find fsynced inode numbers */
+       sbi->por_doing = 1;
        err = find_fsync_dnodes(sbi, &inode_list);
        if (err)
                goto out;
@@ -389,13 +390,12 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
                goto out;
 
        /* step #2: recover data */
-       sbi->por_doing = 1;
        err = recover_data(sbi, &inode_list, CURSEG_WARM_NODE);
-       sbi->por_doing = 0;
        BUG_ON(!list_empty(&inode_list));
 out:
        destroy_fsync_dnodes(sbi, &inode_list);
        kmem_cache_destroy(fsync_entry_slab);
+       sbi->por_doing = 0;
        write_checkpoint(sbi, false);
        return err;
 }