Hi Yunlei,

On Thu, Jul 23, 2015 at 09:43:04AM +0800, Yunlei He wrote:
> In the process of formatting, we zero out only one copy of NAT and
> SIT area, but we use both of them when the filesystem is sucessfully
> mounted. So I change the code to initialize both of two copies in mkfs.

After mounted, the other set will be filled with all valid entries by f2fs.
Is there a bug?

Thanks,

> 
> Signed-off-by: Yunlei He <heyun...@huawei.com>
> ---
>  mkfs/f2fs_format.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index f879bca..b2b3549 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -389,7 +389,7 @@ static int f2fs_init_sit_area(void)
>       sit_seg_addr *= blk_size;
>  
>       DBG(1, "\tFilling sit area at offset 0x%08"PRIx64"\n", sit_seg_addr);
> -     for (index = 0; index < (get_sb(segment_count_sit) / 2); index++) {
> +     for (index = 0; index < get_sb(segment_count_sit); index++) {
>               if (dev_fill(zero_buf, sit_seg_addr, seg_size)) {
>                       MSG(1, "\tError: While zeroing out the sit area \
>                                       on disk!!!\n");
> @@ -423,14 +423,14 @@ static int f2fs_init_nat_area(void)
>       nat_seg_addr *= blk_size;
>  
>       DBG(1, "\tFilling nat area at offset 0x%08"PRIx64"\n", nat_seg_addr);
> -     for (index = 0; index < get_sb(segment_count_nat) / 2; index++) {
> +     for (index = 0; index < get_sb(segment_count_nat); index++) {
>               if (dev_fill(nat_buf, nat_seg_addr, seg_size)) {
>                       MSG(1, "\tError: While zeroing out the nat area \
>                                       on disk!!!\n");
>                       free(nat_buf);
>                       return -1;
>               }
> -             nat_seg_addr = nat_seg_addr + (2 * seg_size);
> +             nat_seg_addr = nat_seg_addr + seg_size;
>       }
>  
>       free(nat_buf);
> -- 
> 1.9.1

------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to