Re: [f2fs-dev] [PATCH v2] f2fs: use adjusted write range after f2fs_write_checks()
Chao Yu via Linux-f2fs-devel <[email protected]>
| Newsgroups | net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel