Re: [PATCH v3 04/17] f2fs: support atomic file large folios buffered write
From: Chao Yu
Date: Sun Oct 11 2026 - 23:07:04 EST
On 10/10/26 00:12, Nanzhe Zhao wrote:
+ /* If index is beyond the end of file, reserve a new block in COW inode */
+ if ((index << PAGE_SHIFT) >= i_size_read(inode))
Can you please check all "xxx << PAGE_SHIFT" statements in patchset to see if there
is overflow issue?
+ if (f2fs_folio_may_unlock_balance_fs(folio, mapping, need_balance)) {
folio_unlock(folio);
- f2fs_balance_fs(sbi, true);
- folio_lock(folio);
- if (folio->mapping != mapping) {
- /* The folio got truncated from under us */
- folio_unlock(folio);
- folio_put(folio);
- goto repeat;
- }
+ folio_put(folio);
Then we can call f2fs_folio_put(, true) to clean up the codes?
if (folio_test_large(folio)) {
- err = prepare_large_folio_write_begin(inode,
+ if (f2fs_is_atomic_file(inode))
+ err = prepare_large_folio_atomic_write_begin(inode,
+ mapping, folio, pos, len);
+ else
+ err = prepare_large_folio_write_begin(inode,
folio, pos, blen);
Same question as it in 03/17, can we relocate?
Thanks,