linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: make sanity_check_ckpt more strict
@ 2013-06-28 15:23 Wang Sheng-Hui
  2013-07-01 23:23 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Sheng-Hui @ 2013-06-28 15:23 UTC (permalink / raw)
  To: jaegeuk.kim, linux-fsdevel

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@gmail.com>
---
  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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs: make sanity_check_ckpt more strict
  2013-06-28 15:23 [PATCH] f2fs: make sanity_check_ckpt more strict Wang Sheng-Hui
@ 2013-07-01 23:23 ` Jaegeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2013-07-01 23:23 UTC (permalink / raw)
  To: Wang Sheng-Hui; +Cc: linux-fsdevel

Hi,

2013-06-28 (금), 23:23 +0800, Wang Sheng-Hui:
> In mkfs, we have check:
>      if ((le32_to_cpu(super_block.segment_count_main) - 2) <
>          config.reserved_segments) {

This is not the sanity check flow.
It's just to check whether the volume size is enoughly large or not.

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

> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>   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;

NAK.
The fsmeta is used to check whether total segment count is matched to
the sum of each area's segment counts.
Thanks,


-- 
Jaegeuk Kim
Samsung

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-01 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28 15:23 [PATCH] f2fs: make sanity_check_ckpt more strict Wang Sheng-Hui
2013-07-01 23:23 ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).