From: Chao Yu <chao@kernel.org>
To: Wu Bo <bo.wu@vivo.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Wu Bo <wubo.oduw@gmail.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] Revert "f2fs: stop allocating pinned sections if EAGAIN happens"
Date: Mon, 5 Feb 2024 11:54:04 +0800 [thread overview]
Message-ID: <793fd834-fe28-4647-b2cf-0012acb95b43@kernel.org> (raw)
In-Reply-To: <20240205031415.557879-1-bo.wu@vivo.com>
On 2024/2/5 11:14, Wu Bo wrote:
> This reverts commit 2e42b7f817acd6e8d78226445eb6fe44fe79c12a.
>
> If the GC victim section has a pinned block when fallocate() trigger
> FG_GC, the section is not able to be recycled. And this will return
> -EAGAIN cause fallocate() failed, even though there are much spare space
> as user see. As the GC policy prone to chose the same victim,
> fallocate() may not successed at a long period.
>
> This scenario has been found during Android OTA.
>
> Link: https://lore.kernel.org/linux-f2fs-devel/20231030094024.263707-1-bo.wu@vivo.com/t/#u
>
> CC: stable@vger.kernel.org
> Signed-off-by: Wu Bo <bo.wu@vivo.com>
> ---
> fs/f2fs/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index b58ab1157b7e..19915faccee9 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1725,7 +1725,7 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset,
> f2fs_down_write(&sbi->gc_lock);
> stat_inc_gc_call_count(sbi, FOREGROUND);
> err = f2fs_gc(sbi, &gc_control);
> - if (err && err != -ENODATA)
> + if (err && err != -ENODATA && err != -EAGAIN)
> goto out_err;
> }
How about calling f2fs_balance_fs() to double check and make sure there is
enough free space for following allocation.
if (has_not_enough_free_secs(sbi, 0,
GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) {
f2fs_down_write(&sbi->gc_lock);
stat_inc_gc_call_count(sbi, FOREGROUND);
err = f2fs_gc(sbi, &gc_control);
if (err == -EAGAIN)
f2fs_balance_fs(sbi, true);
if (err && err != -ENODATA)
goto out_err;
}
Thanks,
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2024-02-05 3:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 3:14 [f2fs-dev] [PATCH] Revert "f2fs: stop allocating pinned sections if EAGAIN happens" Wu Bo via Linux-f2fs-devel
2024-02-05 3:54 ` Chao Yu [this message]
2024-02-08 8:11 ` Wu Bo
2024-02-20 6:50 ` Chao Yu
2024-09-06 8:31 ` Wu Bo via Linux-f2fs-devel
2024-09-06 10:07 ` Chao Yu via Linux-f2fs-devel
2024-09-06 22:52 ` Jaegeuk Kim via Linux-f2fs-devel
2024-09-10 8:33 ` Wu Bo via Linux-f2fs-devel
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=793fd834-fe28-4647-b2cf-0012acb95b43@kernel.org \
--to=chao@kernel.org \
--cc=bo.wu@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wubo.oduw@gmail.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 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).