From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yonggil Song <yonggil.song@samsung.com>
Cc: "daehojeong@google.com" <daehojeong@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>,
Seokhwan Kim <sukka.kim@samsung.com>
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem
Date: Mon, 6 Mar 2023 13:51:59 -0800 [thread overview]
Message-ID: <ZAZgf4sbh14sVZMp@google.com> (raw)
In-Reply-To: <20230216071350epcms2p7b3f5f37b168b634ec7a7ba8555fd0b49@epcms2p7>
On 02/16, 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.
>
> Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
Applied with the below fix.
Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc"
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yonggil Song <yonggil.song@samsung.com>
Cc: Chao Yu <chao@kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"daehojeong@google.com" <daehojeong@google.com>,
Seokhwan Kim <sukka.kim@samsung.com>,
Daejun Park <daejun7.park@samsung.com>
Subject: Re: [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem
Date: Mon, 6 Mar 2023 13:51:59 -0800 [thread overview]
Message-ID: <ZAZgf4sbh14sVZMp@google.com> (raw)
In-Reply-To: <20230216071350epcms2p7b3f5f37b168b634ec7a7ba8555fd0b49@epcms2p7>
On 02/16, 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.
>
> Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
Applied with the below fix.
Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc"
> 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
next prev parent reply other threads:[~2023-03-06 21:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p7>
2023-02-16 7:13 ` [f2fs-dev] [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem Yonggil Song
2023-02-16 7:13 ` Yonggil Song
2023-03-06 21:51 ` Jaegeuk Kim [this message]
2023-03-06 21:51 ` Jaegeuk Kim
2023-03-13 6:11 ` [f2fs-dev] " Chao Yu
2023-03-13 6:11 ` Chao Yu
[not found] <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p3>
2023-02-16 2:57 ` [f2fs-dev] " Yonggil Song
2023-02-16 7:01 ` Miko Larsson
2023-02-16 7:28 ` Yonggil Song
[not found] <CGME20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6@epcms2p4>
2023-02-16 7:44 ` Yonggil Song
2023-02-16 7:46 ` gregkh
2023-03-13 20:20 ` patchwork-bot+f2fs
2023-03-13 20:20 ` patchwork-bot+f2fs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZAZgf4sbh14sVZMp@google.com \
--to=jaegeuk@kernel.org \
--cc=daehojeong@google.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sukka.kim@samsung.com \
--cc=yonggil.song@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.