[PATCH] f2fs: make sanity_check_ckpt more strict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In mkfs, we have check:
    if ((le32_to_cpu(super_block.segment_count_main) - 2) <
        config.reserved_segments) {

In super.c/sanity_check_ckpt, we should make the check as strict
as mkfs.

Signed-off-by: Wang Sheng-Hui <shhuiw@xxxxxxxxx>
---
 fs/f2fs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8555f7d..b64f38a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -448,7 +448,7 @@ static int sanity_check_ckpt(struct f2fs_sb_info *sbi)
 	fsmeta = le32_to_cpu(raw_super->segment_count_ckpt);
 	fsmeta += le32_to_cpu(raw_super->segment_count_sit);
 	fsmeta += le32_to_cpu(raw_super->segment_count_nat);
-	fsmeta += le32_to_cpu(ckpt->rsvd_segment_count);
+	fsmeta += le32_to_cpu(ckpt->rsvd_segment_count) + 2;
 	fsmeta += le32_to_cpu(raw_super->segment_count_ssa);

 	if (fsmeta >= total)
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux