From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Joanne Chang <joannechien@google.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v1] f2fs: allow pinning empty compressed files
Date: Sun, 11 Oct 2026 16:31:05 +0800 [thread overview]
Message-ID: <2ae11ebc-dd27-409f-9b9f-a153fe310178@kernel.org> (raw)
In-Reply-To: <20261009095335.749891-1-joannechien@google.com>
On 10/9/26 17:53, Joanne Chang wrote:
> Commit a64a3fec11e7 ("f2fs: force out-place update for all writes on
> compressed file") updated f2fs_should_update_outplace() to always
> return true for compressed files. However, this function is also
> called during f2fs_ioc_set_pin_file() validation, so pinning an
> empty file with compression enabled now fails with -EINVAL before the
> compression flag can be stripped.
Joanne,
Thanks for the patch.
But, I think it's as expected, we force compressed file to OPU, and pinfile
to IPU, it's conflict.
Let me know if I missed something.
Thanks,
>
> Fix this by guarding the f2fs_compressed_file(inode) check with fio in
> f2fs_should_update_outplace(). This preserves forced OPU for actual
> compressed writes (fio != NULL), while allowing f2fs_ioc_set_pin_file()
> (fio == NULL) to proceed to f2fs_disable_compressed_file(inode).
>
> Fixes: a64a3fec11e7 ("f2fs: force out-place update for all writes on compressed file")
> Assisted-by: LLM
> Signed-off-by: Joanne Chang <joannechien@google.com>
> ---
> fs/f2fs/data.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 2613e8821af6..1d071e7cb1c2 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -3150,7 +3150,7 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
> * If IO comes from compressed write path and fallback to raw write,
> * force out‑place to prevent metadata‑data inconsistency.
> */
> - if (f2fs_compressed_file(inode))
> + if (fio && f2fs_compressed_file(inode))
> return true;
>
> /* swap file is migrating in aligned write mode */
_______________________________________________
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:[~2026-10-11 8:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 9:53 [f2fs-dev] [PATCH v1] f2fs: allow pinning empty compressed files Joanne Chang via Linux-f2fs-devel
2026-10-11 8:31 ` Chao Yu via Linux-f2fs-devel [this message]
2026-10-12 9:27 ` Joanne Chang via Linux-f2fs-devel
2026-10-12 9:38 ` Chao Yu via Linux-f2fs-devel
2026-10-12 9:40 ` Chao Yu via Linux-f2fs-devel
2026-10-13 22:30 ` patchwork-bot+f2fs--- 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=2ae11ebc-dd27-409f-9b9f-a153fe310178@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=joannechien@google.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.