linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem
       [not found] <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p2>
@ 2023-02-15  2:48 ` Yonggil Song
  2023-02-15 15:07   ` Chao Yu
       [not found]   ` <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p1>
  0 siblings, 2 replies; 3+ messages in thread
From: Yonggil Song @ 2023-02-15  2:48 UTC (permalink / raw)
  To: jaegeuk, chao, linux-f2fs-devel, linux-kernel; +Cc: Seokhwan Kim

When f2fs skipped a gc round during victim migration, there was a bug which
would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem
was not initialized. It fixes the bug by correctly initializing the
skipped_gc_rwsem inside the gc loop.

Fixes: d147ea4adb96 ("f2fs: introduce f2fs_gc_control to consolidate f2fs_gc parameters")
Signed-off-by: Yonggil Song <yonggil.song@samsung.com>

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b22f49a6f128..81d326abaac1 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1786,8 +1786,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control)
 				prefree_segments(sbi));
 
 	cpc.reason = __get_cp_reason(sbi);
-	sbi->skipped_gc_rwsem = 0;
 gc_more:
+	sbi->skipped_gc_rwsem = 0;
 	if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
 		ret = -EINVAL;
 		goto stop;
-- 
2.34.1


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

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

* Re: [f2fs-dev] [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem
  2023-02-15  2:48 ` [f2fs-dev] [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem Yonggil Song
@ 2023-02-15 15:07   ` Chao Yu
       [not found]   ` <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p1>
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2023-02-15 15:07 UTC (permalink / raw)
  To: yonggil.song, jaegeuk, linux-f2fs-devel, linux-kernel; +Cc: Seokhwan Kim

On 2023/2/15 10:48, Yonggil Song wrote:
> When f2fs skipped a gc round during victim migration, there was a bug which
> would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem
> was not initialized. It fixes the bug by correctly initializing the
> skipped_gc_rwsem inside the gc loop.

It makes sense to me.

> 
> Fixes: d147ea4adb96 ("f2fs: introduce f2fs_gc_control to consolidate f2fs_gc parameters")

How does this commits introduce the bug?

Thanks,

> Signed-off-by: Yonggil Song <yonggil.song@samsung.com>
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index b22f49a6f128..81d326abaac1 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1786,8 +1786,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control)
>   				prefree_segments(sbi));
>   
>   	cpc.reason = __get_cp_reason(sbi);
> -	sbi->skipped_gc_rwsem = 0;
>   gc_more:
> +	sbi->skipped_gc_rwsem = 0;
>   	if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
>   		ret = -EINVAL;
>   		goto stop;


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

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

* Re: [f2fs-dev] (2) [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem
       [not found]   ` <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p1>
@ 2023-02-16  2:02     ` Yonggil Song
  0 siblings, 0 replies; 3+ messages in thread
From: Yonggil Song @ 2023-02-16  2:02 UTC (permalink / raw)
  To: Chao Yu, jaegeuk, linux-f2fs-devel, linux-kernel; +Cc: Seokhwan Kim

On 2023/2/15 10:48, Yonggil Song wrote:
>> When f2fs skipped a gc round during victim migration, there was a bug which
>> would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem
>> was not initialized. It fixes the bug by correctly initializing the
>> skipped_gc_rwsem inside the gc loop.
>
>It makes sense to me.
>
>> 
>> Fixes: d147ea4adb96 ("f2fs: introduce f2fs_gc_control to consolidate f2fs_gc parameters")
>
>How does this commits introduce the bug?

Oh, sorry I've got wrong hash.
I'll send right hash on PATCH v2.

Thanks for your comment.

>
>Thanks,
>
>> Signed-off-by: Yonggil Song <yonggil.song@samsung.com>
>> 
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index b22f49a6f128..81d326abaac1 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -1786,8 +1786,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control)
>>   				prefree_segments(sbi));
>>   
>>   	cpc.reason = __get_cp_reason(sbi);
>> -	sbi->skipped_gc_rwsem = 0;
>>   gc_more:
>> +	sbi->skipped_gc_rwsem = 0;
>>   	if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
>>   		ret = -EINVAL;
>>   		goto stop;


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

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

end of thread, other threads:[~2023-02-16  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p2>
2023-02-15  2:48 ` [f2fs-dev] [PATCH v1] f2fs: fix uninitialized skipped_gc_rwsem Yonggil Song
2023-02-15 15:07   ` Chao Yu
     [not found]   ` <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p1>
2023-02-16  2:02     ` [f2fs-dev] (2) " Yonggil Song

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).