From: Chao Yu <chao@kernel.org>
To: Seongjae Jeong <jsjlee1020@gmail.com>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: chao@kernel.org, Daeho Jeong <daehojeong@google.com>,
Yonggil Song <yonggil.song@samsung.com>,
Hans Holmberg <hans.holmberg@wdc.com>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: use adjusted write range after f2fs_write_checks()
Date: Mon, 24 Aug 2026 16:53:06 +0800 [thread overview]
Message-ID: <0229529e-03e0-4684-a8c5-015113858640@kernel.org> (raw)
In-Reply-To: <20260824023231.24616-1-jsjlee1020@gmail.com>
On 8/24/26 10:32, Seongjae Jeong wrote:
> generic_write_checks() in f2fs_write_checks() can adjust iocb->ki_pos
> for append writes and truncate the iterator to limit the number of bytes
> to write.
>
> In f2fs_file_write_iter(), the pinned-file overwrite check currently
> uses the position and count saved before f2fs_write_checks(), so it
> can check a range different from the actual write range.
>
> The forced buffered I/O cleanup also uses orig_pos saved before
> f2fs_write_checks(). For O_APPEND writes, this can make the cleanup
> flush and invalidate the wrong page cache range.
>
> Move the pinned-file overwrite check after f2fs_write_checks() and use
> the adjusted iocb->ki_pos and iov_iter_count(from). Also save the
> adjusted write position and use it for the forced buffered I/O cleanup.
>
> Fixes: 3fdd89b452c2 ("f2fs: prevent writing without fallocate() for pinned files")
> Fixes: 92318f20d703 ("f2fs: preserve direct write semantics when buffering is forced")
> Signed-off-by: Seongjae Jeong <jsjlee1020@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
next prev parent reply other threads:[~2026-08-24 8:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 2:32 [PATCH v2] f2fs: use adjusted write range after f2fs_write_checks() Seongjae Jeong
2026-08-24 8:53 ` Chao Yu [this message]
2026-08-25 15:40 ` [f2fs-dev] " 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=0229529e-03e0-4684-a8c5-015113858640@kernel.org \
--to=chao@kernel.org \
--cc=daehojeong@google.com \
--cc=hans.holmberg@wdc.com \
--cc=jaegeuk@kernel.org \
--cc=jsjlee1020@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox