Re: [PATCH] f2fs: fix O_DIRECT cleanup range for append writes

From: 정성재

Date: Tue Aug 18 2026 - 08:24:29 EST


> If generic_write_checks() can adjust writing position or amount of bytes
> to write, shouldn't we access iocb->ki_pos and iov_iter_count(from) after
> generic_write_checks()?

Yes, agreed. generic_write_checks() can adjust both iocb->ki_pos and
the iterator count.

I noticed that the pinned file overwrite check uses pos and count
saved before f2fs_write_checks(). I plan to keep the check in
f2fs_file_write_iter(), but move it after f2fs_write_checks() and use
the adjusted iocb->ki_pos and iov_iter_count(from).

This also keeps the change local to f2fs_file_write_iter(), where other
checks are already performed after f2fs_write_checks().

For the buffered cleanup, as in my original patch, I plan to save the
adjusted write position after f2fs_write_checks() and use it for
f2fs_flush_buffered_write().

Does this approach look reasonable to you?

Thanks,
Seongjae