Skip to contentSkip to conversation

fsck.f2fs: account COMPRESS_ADDR as reserved blocks correctly

PATCH New Chao Yu 1 participant 1 message Mar 5, 2020

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 fsck.f2fs: account COMPRESS_ADDR as reserved blocks correctly

We should not account COMPRESS_ADDR as reserved block once we released compress block on compress inode.

---
 fsck/fsck.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
fsck/fsck.c +8 -4
index 4d8aff0..f754858 100644
@@ -860,8 +860,10 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
 		check_extent_info(&child, blkaddr, 0);
 
 		if (blkaddr == COMPRESS_ADDR) {
-			fsck->chk.valid_blk_cnt++;
-			*blk_cnt = *blk_cnt + 1;
+			if (node_blk->i.i_compr_blocks) {
+				fsck->chk.valid_blk_cnt++;
+				*blk_cnt = *blk_cnt + 1;
+			}
 			continue;
 		}
 
@@ -1103,8 +1105,10 @@ int fsck_chk_dnode_blk(struct f2fs_sb_info *sbi, struct f2fs_inode *inode,
 		if (blkaddr == 0x0)
 			continue;
 		if (blkaddr == COMPRESS_ADDR) {
-			F2FS_FSCK(sbi)->chk.valid_blk_cnt++;
-			*blk_cnt = *blk_cnt + 1;
+			if (inode->i_compr_blocks) {
+				F2FS_FSCK(sbi)->chk.valid_blk_cnt++;
+				*blk_cnt = *blk_cnt + 1;
+			}
 			continue;
 		}
 		ret = fsck_chk_data_blk(sbi, IS_CASEFOLDED(inode),
Signature · 8 lines
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel