Re: [PATCH] f2fs: fix O_DIRECT cleanup range for append writes
From: Chao Yu
Date: Tue Aug 18 2026 - 21:47:15 EST
On 8/18/26 20:23, 정성재 wrote:
>> 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).
Yeah, I think it's the correct way.
>
> 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?
It make sense, please go ahead. :)
Thanks,
>
> Thanks,
> Seongjae