|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6 |
|
| #
7ff0104a |
| 07-Mar-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Remove f2fs_write_node_page()
Mappings which implement writepages should not implement writepage as it can only harm writeback patterns.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradea
f2fs: Remove f2fs_write_node_page()
Mappings which implement writepages should not implement writepage as it can only harm writeback patterns.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
19426c49 |
| 05-Mar-2025 |
Chao Yu <[email protected]> |
Revert "f2fs: rebuild nat_bits during umount"
This reverts commit 94c821fb286b545d37549ff30a0c341e066f0d6c.
It reports that there is potential corruption in node footer, the most suspious feature i
Revert "f2fs: rebuild nat_bits during umount"
This reverts commit 94c821fb286b545d37549ff30a0c341e066f0d6c.
It reports that there is potential corruption in node footer, the most suspious feature is nat_bits, let's revert recovery related code.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
1788971e |
| 05-Mar-2025 |
Chao Yu <[email protected]> |
f2fs: introduce FAULT_INCONSISTENT_FOOTER
To simulate inconsistent node footer error.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
|
| #
2aac2538 |
| 05-Mar-2025 |
Chao Yu <[email protected]> |
f2fs: do sanity check on xattr node footer in f2fs_get_xnode_page()
This patch introduces a new wrapper f2fs_get_xnode_page(), then, caller can use it to load xattr block to page cache, meanwhile it
f2fs: do sanity check on xattr node footer in f2fs_get_xnode_page()
This patch introduces a new wrapper f2fs_get_xnode_page(), then, caller can use it to load xattr block to page cache, meanwhile it will do sanity check on xattr node footer.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
1cf6b567 |
| 05-Mar-2025 |
Chao Yu <[email protected]> |
f2fs: do sanity check on inode footer in f2fs_get_inode_page()
This patch introduces a new wrapper f2fs_get_inode_page(), then, caller can use it to load inode block to page cache, meanwhile it will
f2fs: do sanity check on inode footer in f2fs_get_inode_page()
This patch introduces a new wrapper f2fs_get_inode_page(), then, caller can use it to load inode block to page cache, meanwhile it will do sanity check on inode footer.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
c2ecba02 |
| 08-Mar-2025 |
Chao Yu <[email protected]> |
f2fs: control nat_bits feature via mount option
Introduce a new mount option "nat_bits" to control nat_bits feature, by default nat_bits feature is disabled.
Signed-off-by: Chao Yu <[email protected]
f2fs: control nat_bits feature via mount option
Introduce a new mount option "nat_bits" to control nat_bits feature, by default nat_bits feature is disabled.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc5, v6.14-rc4 |
|
| #
520b17e0 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Use a folio throughout f2fs_truncate_inode_blocks()
Use f2fs_get_node_folio() to get a folio and use it throughout. Remove a few calls to compound_head() and a reference to page->mapping.
Si
f2fs: Use a folio throughout f2fs_truncate_inode_blocks()
Use f2fs_get_node_folio() to get a folio and use it throughout. Remove a few calls to compound_head() and a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
4d417ae2 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Add f2fs_get_node_folio()
Change __get_node_page() to return a folio and convert back to a page in f2fs_get_node_page() and f2fs_get_node_page_ra().
Signed-off-by: Matthew Wilcox (Oracle) <wi
f2fs: Add f2fs_get_node_folio()
Change __get_node_page() to return a folio and convert back to a page in f2fs_get_node_page() and f2fs_get_node_page_ra().
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
1a58a41c |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Convert f2fs_in_warm_node_list() to take a folio
All its callers now have access to a folio, so pass it in. Removes an access to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <willy@
f2fs: Convert f2fs_in_warm_node_list() to take a folio
All its callers now have access to a folio, so pass it in. Removes an access to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
48a34c59 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Use a folio in __get_node_page()
Retrieve a folio from the page cache and use it throughout. Saves six hidden calls to compound_head() and removes a reference to page->mapping.
Signed-off-by
f2fs: Use a folio in __get_node_page()
Retrieve a folio from the page cache and use it throughout. Saves six hidden calls to compound_head() and removes a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
e11a3113 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Return a folio from last_fsync_dnode()
Convert last_page to last_folio in f2fs_fsync_node_pages() and use folio APIs where they exist. Saves a few hidden calls to compound_head().
Signed-off
f2fs: Return a folio from last_fsync_dnode()
Convert last_page to last_folio in f2fs_fsync_node_pages() and use folio APIs where they exist. Saves a few hidden calls to compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
18f3814f |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Convert last_fsync_dnode() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: Matth
f2fs: Convert last_fsync_dnode() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
e23bebc3 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Convert f2fs_fsync_node_pages() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by:
f2fs: Convert f2fs_fsync_node_pages() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
de90f761 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Pass a folio to flush_dirty_inode()
Its one caller now has a folio; pass it in and do page conversions where necessary inside flush_dirty_inode(). Saves two hidden calls to compound_head().
f2fs: Pass a folio to flush_dirty_inode()
Its one caller now has a folio; pass it in and do page conversions where necessary inside flush_dirty_inode(). Saves two hidden calls to compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
5d0a9128 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Convert f2fs_sync_node_pages() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: M
f2fs: Convert f2fs_sync_node_pages() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
015d9c56 |
| 18-Feb-2025 |
Matthew Wilcox (Oracle) <[email protected]> |
f2fs: Convert f2fs_flush_inline_data() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by:
f2fs: Convert f2fs_flush_inline_data() to use a folio
Use the folio APIs where they exist. Saves several hidden calls to compound_head(). Also removes a reference to page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
e6494977 |
| 03-Mar-2025 |
Chao Yu <[email protected]> |
f2fs: fix to avoid out-of-bounds access in f2fs_truncate_inode_blocks()
syzbot reports an UBSAN issue as below:
------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/f2fs/node
f2fs: fix to avoid out-of-bounds access in f2fs_truncate_inode_blocks()
syzbot reports an UBSAN issue as below:
------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/f2fs/node.h:381:10 index 18446744073709550692 is out of range for type '__le32[5]' (aka 'unsigned int[5]') CPU: 0 UID: 0 PID: 5318 Comm: syz.0.0 Not tainted 6.14.0-rc3-syzkaller-00060-g6537cfb395f3 #0 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0x121/0x150 lib/ubsan.c:429 get_nid fs/f2fs/node.h:381 [inline] f2fs_truncate_inode_blocks+0xa5e/0xf60 fs/f2fs/node.c:1181 f2fs_do_truncate_blocks+0x782/0x1030 fs/f2fs/file.c:808 f2fs_truncate_blocks+0x10d/0x300 fs/f2fs/file.c:836 f2fs_truncate+0x417/0x720 fs/f2fs/file.c:886 f2fs_file_write_iter+0x1bdb/0x2550 fs/f2fs/file.c:5093 aio_write+0x56b/0x7c0 fs/aio.c:1633 io_submit_one+0x8a7/0x18a0 fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit+0x171/0x2e0 fs/aio.c:2081 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f238798cde9
index 18446744073709550692 (decimal, unsigned long long) = 0xfffffffffffffc64 (hexadecimal, unsigned long long) = -924 (decimal, long long)
In f2fs_truncate_inode_blocks(), UBSAN detects that get_nid() tries to access .i_nid[-924], it means both offset[0] and level should zero.
The possible case should be in f2fs_do_truncate_blocks(), we try to truncate inode size to zero, however, dn.ofs_in_node is zero and dn.node_page is not an inode page, so it fails to truncate inode page, and then pass zeroed free_from to f2fs_truncate_inode_blocks(), result in this issue.
if (dn.ofs_in_node || IS_INODE(dn.node_page)) { f2fs_truncate_data_blocks_range(&dn, count); free_from += count; }
I guess the reason why dn.node_page is not an inode page could be: there are multiple nat entries share the same node block address, once the node block address was reused, f2fs_get_node_page() may load a non-inode block.
Let's add a sanity check for such condition to avoid out-of-bounds access issue.
Reported-by: [email protected] Closes: https://lore.kernel.org/all/[email protected] Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5 |
|
| #
e53c568f |
| 23-Dec-2024 |
Yi Sun <[email protected]> |
f2fs: add parameter @len to f2fs_invalidate_blocks()
New function can process some consecutive blocks at a time.
Function f2fs_invalidate_blocks()->down_write() and up_write() are very time-consumi
f2fs: add parameter @len to f2fs_invalidate_blocks()
New function can process some consecutive blocks at a time.
Function f2fs_invalidate_blocks()->down_write() and up_write() are very time-consuming, so if f2fs_invalidate_blocks() can process consecutive blocks at one time, it will save a lot of time.
Signed-off-by: Yi Sun <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
cf5817ce |
| 07-Jan-2025 |
Jaegeuk Kim <[email protected]> |
f2fs: don't call block truncation for aliased file
This patch should avoid the below warning which does not corrupt the metadata tho.
[ 51.508120][ T253] F2FS-fs (dm-59): access invalid blkaddr:
f2fs: don't call block truncation for aliased file
This patch should avoid the below warning which does not corrupt the metadata tho.
[ 51.508120][ T253] F2FS-fs (dm-59): access invalid blkaddr:36 [ 51.508156][ T253] __f2fs_is_valid_blkaddr+0x330/0x384 [ 51.508162][ T253] f2fs_is_valid_blkaddr_raw+0x10/0x24 [ 51.508163][ T253] f2fs_truncate_data_blocks_range+0x1ec/0x438 [ 51.508177][ T253] f2fs_remove_inode_page+0x8c/0x148 [ 51.508194][ T253] f2fs_evict_inode+0x230/0x76c
Fixes: 128d333f0dff ("f2fs: introduce device aliasing file") Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc4, v6.13-rc3 |
|
| #
76f01376 |
| 12-Dec-2024 |
Dmitry Antipov <[email protected]> |
f2fs: ensure that node info flags are always initialized
Syzbot has reported the following KMSAN splat:
BUG: KMSAN: uninit-value in f2fs_new_node_page+0x1494/0x1630 f2fs_new_node_page+0x1494/0x163
f2fs: ensure that node info flags are always initialized
Syzbot has reported the following KMSAN splat:
BUG: KMSAN: uninit-value in f2fs_new_node_page+0x1494/0x1630 f2fs_new_node_page+0x1494/0x1630 f2fs_new_inode_page+0xb9/0x100 f2fs_init_inode_metadata+0x176/0x1e90 f2fs_add_inline_entry+0x723/0xc90 f2fs_do_add_link+0x48f/0xa70 f2fs_symlink+0x6af/0xfc0 vfs_symlink+0x1f1/0x470 do_symlinkat+0x471/0xbc0 __x64_sys_symlink+0xcf/0x140 x64_sys_call+0x2fcc/0x3d90 do_syscall_64+0xd9/0x1b0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
Local variable new_ni created at: f2fs_new_node_page+0x9d/0x1630 f2fs_new_inode_page+0xb9/0x100
So adjust 'f2fs_get_node_info()' to ensure that 'flag' field of 'struct node_info' is always initialized.
Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=5141f6db57a2f7614352 Fixes: e05df3b115e7 ("f2fs: add node operations") Suggested-by: Chao Yu <[email protected]> Signed-off-by: Dmitry Antipov <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc2, v6.13-rc1 |
|
| #
81520c68 |
| 20-Nov-2024 |
Chao Yu <[email protected]> |
f2fs: print message if fscorrupted was found in f2fs_new_node_page()
If fs corruption occurs in f2fs_new_node_page(), let's print more information about corrupted metadata into kernel log.
Meanwhil
f2fs: print message if fscorrupted was found in f2fs_new_node_page()
If fs corruption occurs in f2fs_new_node_page(), let's print more information about corrupted metadata into kernel log.
Meanwhile, it updates to record ERROR_INCONSISTENT_NAT instead of ERROR_INVALID_BLKADDR if blkaddr in nat entry is not NULL_ADDR which means nat bitmap and nat entry is inconsistent.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.12, v6.12-rc7, v6.12-rc6 |
|
| #
cffaa097 |
| 29-Oct-2024 |
Chao Yu <[email protected]> |
f2fs: clean up opened code w/ {get,set}_nid()
Just cleanup, no logic change.
Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
|
|
Revision tags: v6.12-rc5, v6.12-rc4 |
|
| #
6babe00c |
| 16-Oct-2024 |
Chao Yu <[email protected]> |
f2fs: fix to do sanity check on node blkaddr in truncate_node()
syzbot reports a f2fs bug as below:
------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:2534! RIP: 0010:f2fs_invalid
f2fs: fix to do sanity check on node blkaddr in truncate_node()
syzbot reports a f2fs bug as below:
------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:2534! RIP: 0010:f2fs_invalidate_blocks+0x35f/0x370 fs/f2fs/segment.c:2534 Call Trace: truncate_node+0x1ae/0x8c0 fs/f2fs/node.c:909 f2fs_remove_inode_page+0x5c2/0x870 fs/f2fs/node.c:1288 f2fs_evict_inode+0x879/0x15c0 fs/f2fs/inode.c:856 evict+0x4e8/0x9b0 fs/inode.c:723 f2fs_handle_failed_inode+0x271/0x2e0 fs/f2fs/inode.c:986 f2fs_create+0x357/0x530 fs/f2fs/namei.c:394 lookup_open fs/namei.c:3595 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 do_sys_openat2+0x13e/0x1d0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1441 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0010:f2fs_invalidate_blocks+0x35f/0x370 fs/f2fs/segment.c:2534
The root cause is: on a fuzzed image, blkaddr in nat entry may be corrupted, then it will cause system panic when using it in f2fs_invalidate_blocks(), to avoid this, let's add sanity check on nat blkaddr in truncate_node().
Reported-by: [email protected] Closes: https://lore.kernel.org/linux-f2fs-devel/[email protected]/ Cc: [email protected] Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
|
Revision tags: v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5 |
|
| #
5697e94d |
| 20-Aug-2024 |
Chao Yu <[email protected]> |
f2fs: get rid of page->index
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/all/Zp8fgUSIBGQ
f2fs: get rid of page->index
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/all/[email protected]/
Cc: Matthew Wilcox <[email protected]> Signed-off-by: Chao Yu <[email protected]> Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|
| #
2eaa98e5 |
| 20-Aug-2024 |
Chao Yu <[email protected]> |
f2fs: convert read_node_page() to use folio
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/
f2fs: convert read_node_page() to use folio
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/all/[email protected]/
Cc: Matthew Wilcox <[email protected]> Signed-off-by: Chao Yu <[email protected]> Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
show more ...
|