fsck.f2fs: calculate orphan_blkaddr correctly
authorJunling Zheng <zhengjunling@huawei.com>
Wed, 16 Mar 2016 10:03:05 +0000 (18:03 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 17 Mar 2016 23:31:52 +0000 (16:31 -0700)
Commit 4ea4f1db ("fsck.f2fs: large volume support") added the support
for large volume over about 3TB. The "cp_payload" is added to start_blk,
but not removed from orphan_blkaddr.

Fixes: 4ea4f1db ("fsck.f2fs: large volume support")
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/fsck.c

index aaaa95b..c68eae7 100644 (file)
@@ -1474,7 +1474,7 @@ void fsck_chk_orphan_node(struct f2fs_sb_info *sbi)
                return;
 
        start_blk = __start_cp_addr(sbi) + 1 + get_sb(cp_payload);
-       orphan_blkaddr = __start_sum_addr(sbi) - 1;
+       orphan_blkaddr = __start_sum_addr(sbi) - 1 - get_sb(cp_payload);
 
        orphan_blk = calloc(BLOCK_SZ, 1);
        ASSERT(orphan_blk);