linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] mkfs.f2fs: give random checkpoint version
@ 2016-11-25  2:32 Jaegeuk Kim
  2016-12-10  7:42 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2016-11-25  2:32 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

This is to avoid wrong recovery during xfstests.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 mkfs/f2fs_format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 9a536f0..d2254e7 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -507,7 +507,7 @@ static int f2fs_write_check_point_pack(void)
 	}
 
 	/* 1. cp page 1 of checkpoint pack 1 */
-	set_cp(checkpoint_ver, 1);
+	cp->checkpoint_ver = rand();
 	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
 	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
 	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
-- 
2.8.3


------------------------------------------------------------------------------

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

* Re: [PATCH] mkfs.f2fs: give random checkpoint version
  2016-11-25  2:32 [PATCH] mkfs.f2fs: give random checkpoint version Jaegeuk Kim
@ 2016-12-10  7:42 ` Chao Yu
  2016-12-12 18:59   ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2016-12-10  7:42 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-f2fs-devel

Hi Jaegeuk,

On 2016/11/25 10:32, Jaegeuk Kim wrote:
> This is to avoid wrong recovery during xfstests.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  mkfs/f2fs_format.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 9a536f0..d2254e7 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -507,7 +507,7 @@ static int f2fs_write_check_point_pack(void)
>  	}
>  
>  	/* 1. cp page 1 of checkpoint pack 1 */
> -	set_cp(checkpoint_ver, 1);
> +	cp->checkpoint_ver = rand();

I can see the last patch merged in upstream is:

+	cp->checkpoint_ver = rand() | 0x1;

Any difference and why don't we use set_cp?

Thanks,

>  	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
>  	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
>  	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
> 


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi

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

* Re: [PATCH] mkfs.f2fs: give random checkpoint version
  2016-12-10  7:42 ` Chao Yu
@ 2016-12-12 18:59   ` Jaegeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2016-12-12 18:59 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel

Hi,

On 12/10, Chao Yu wrote:
> Hi Jaegeuk,
> 
> On 2016/11/25 10:32, Jaegeuk Kim wrote:
> > This is to avoid wrong recovery during xfstests.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >  mkfs/f2fs_format.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> > index 9a536f0..d2254e7 100644
> > --- a/mkfs/f2fs_format.c
> > +++ b/mkfs/f2fs_format.c
> > @@ -507,7 +507,7 @@ static int f2fs_write_check_point_pack(void)
> >  	}
> >  
> >  	/* 1. cp page 1 of checkpoint pack 1 */
> > -	set_cp(checkpoint_ver, 1);
> > +	cp->checkpoint_ver = rand();
> 
> I can see the last patch merged in upstream is:
> 
> +	cp->checkpoint_ver = rand() | 0x1;
> 
> Any difference and why don't we use set_cp?

In order to support old f2fs driver, we should at least keep the ordering
by default, since such the version conversion would not be a normal case.

Thanks,

> 
> Thanks,
> 
> >  	set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]);
> >  	set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]);
> >  	set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]);
> > 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

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

end of thread, other threads:[~2016-12-12 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-25  2:32 [PATCH] mkfs.f2fs: give random checkpoint version Jaegeuk Kim
2016-12-10  7:42 ` Chao Yu
2016-12-12 18:59   ` 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).