Skip to contentSkip to conversation

fsck.f2fs: calculate orphan_blkaddr correctly

PATCH New Junling Zheng 1 participant 1 message Mar 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsck.f2fs: calculate orphan_blkaddr correctly

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")
---
 fsck/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/fsck.c +1 -1
index 6f47c5d..624adae 100644
@@ -1426,7 +1426,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);
Signature · 9 lines
1.9.1


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140