diff mbox

[1/2] f2fs: check only data or node for summary

Message ID 20160610210107.74181-1-jaegeuk@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jaegeuk Kim June 10, 2016, 9:01 p.m. UTC
We can check data or node types only for gc, since we allocate different type of
data/node blocks in a different logs occasionally.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/gc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

He YunLei July 6, 2016, 4:09 a.m. UTC | #1
On 2016/6/11 5:01, Jaegeuk Kim wrote:
> We can check data or node types only for gc, since we allocate different type of
> data/node blocks in a different logs occasionally.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>   fs/f2fs/gc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index e1d274c..c2c4ac3 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -806,7 +806,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
>   		f2fs_put_page(sum_page, 0);
>
>   		sum = page_address(sum_page);
> -		f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
> +		f2fs_bug_on(sbi, IS_DATASEG(type) !=
> +				IS_DATASEG(GET_SUM_TYPE((&sum->footer))));

Hi, Kim
	type has been transformed into SUM_TYPE_DATA or SUM_TYPE_NODE, so here
no need to do this.

Thanks
>
>   		/*
>   		 * this is to avoid deadlock:
>

--
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
Jaegeuk Kim July 6, 2016, 5:50 p.m. UTC | #2
On Wed, Jul 06, 2016 at 12:09:12PM +0800, He YunLei wrote:
> On 2016/6/11 5:01, Jaegeuk Kim wrote:
> > We can check data or node types only for gc, since we allocate different type of
> > data/node blocks in a different logs occasionally.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >   fs/f2fs/gc.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> > index e1d274c..c2c4ac3 100644
> > --- a/fs/f2fs/gc.c
> > +++ b/fs/f2fs/gc.c
> > @@ -806,7 +806,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
> >   		f2fs_put_page(sum_page, 0);
> > 
> >   		sum = page_address(sum_page);
> > -		f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
> > +		f2fs_bug_on(sbi, IS_DATASEG(type) !=
> > +				IS_DATASEG(GET_SUM_TYPE((&sum->footer))));
> 
> Hi, Kim
> 	type has been transformed into SUM_TYPE_DATA or SUM_TYPE_NODE, so here
> no need to do this.

Oops, right. :)

Thanks,

--
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
diff mbox

Patch

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e1d274c..c2c4ac3 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -806,7 +806,8 @@  static int do_garbage_collect(struct f2fs_sb_info *sbi,
 		f2fs_put_page(sum_page, 0);
 
 		sum = page_address(sum_page);
-		f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
+		f2fs_bug_on(sbi, IS_DATASEG(type) !=
+				IS_DATASEG(GET_SUM_TYPE((&sum->footer))));
 
 		/*
 		 * this is to avoid deadlock: