<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/f2fs/checkpoint.c, branch linux-6.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-03-26T22:18:49Z</updated>
<entry>
<title>f2fs: fix to truncate meta inode pages forcely</title>
<updated>2024-03-26T22:18:49Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2024-03-08T01:08:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77bfdb89cc222fc7bfe198eda77bdc427d5ac189'/>
<id>urn:sha1:77bfdb89cc222fc7bfe198eda77bdc427d5ac189</id>
<content type='text'>
[ Upstream commit 9f0c4a46be1fe9b97dbe66d49204c1371e3ece65 ]

Below race case can cause data corruption:

Thread A				GC thread
					- gc_data_segment
					 - ra_data_block
					  - locked meta_inode page
- f2fs_inplace_write_data
 - invalidate_mapping_pages
 : fail to invalidate meta_inode page
   due to lock failure or dirty|writeback
   status
 - f2fs_submit_page_bio
 : write last dirty data to old blkaddr
					 - move_data_block
					  - load old data from meta_inode page
					  - f2fs_submit_page_write
					  : write old data to new blkaddr

Because invalidate_mapping_pages() will skip invalidating page which
has unclear status including locked, dirty, writeback and so on, so
we need to use truncate_inode_pages_range() instead of
invalidate_mapping_pages() to make sure meta_inode page will be dropped.

Fixes: 6aa58d8ad20a ("f2fs: readahead encrypted block during GC")
Fixes: e3b49ea36802 ("f2fs: invalidate META_MAPPING before IPU/DIO write")
Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix to account cp stats correctly</title>
<updated>2023-08-14T20:42:05Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2023-08-08T00:59:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb61c2cca2eb2110cc7b61a7bc15b3850977a778'/>
<id>urn:sha1:eb61c2cca2eb2110cc7b61a7bc15b3850977a778</id>
<content type='text'>
cp_foreground_calls sysfs entry shows total CP call count rather than
foreground CP call count, fix it.

Fixes: fc7100ea2a52 ("f2fs: Add f2fs stats to sysfs")
Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: support errors=remount-ro|continue|panic mountoption</title>
<updated>2023-05-08T18:18:04Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2023-04-23T15:49:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5'/>
<id>urn:sha1:b62e71be2110d8b52bf5faf3c3ed7ca1a0c113a5</id>
<content type='text'>
This patch supports errors=remount-ro|continue|panic mount option
for f2fs.

f2fs behaves as below in three different modes:
mode			continue	remount-ro	panic
access ops		normal		noraml		N/A
syscall errors		-EIO		-EROFS		N/A
mount option		rw		ro		N/A
pending dir write	keep		keep		N/A
pending non-dir write	drop		keep		N/A
pending node write	drop		keep		N/A
pending meta write	keep		keep		N/A

By default it uses "continue" mode.

[Yangtao helps to clean up function's name]
Signed-off-by: Yangtao Li &lt;frank.li@vivo.com&gt;
Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: relax sanity check if checkpoint is corrupted</title>
<updated>2023-04-18T16:05:54Z</updated>
<author>
<name>Jaegeuk Kim</name>
</author>
<published>2023-04-06T23:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bd90c5cd339a9d7cdc609d2d6310b80dc697070d'/>
<id>urn:sha1:bd90c5cd339a9d7cdc609d2d6310b80dc697070d</id>
<content type='text'>
1. extent_cache
 - let's drop the largest extent_cache
2. invalidate_block
 - don't show the warnings

Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: add radix_tree_preload_end in error case</title>
<updated>2023-04-13T03:00:37Z</updated>
<author>
<name>Yohan Joung</name>
</author>
<published>2023-03-27T13:58:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d09bd853005c720d5578f80b34e144ff3bc3eae8'/>
<id>urn:sha1:d09bd853005c720d5578f80b34e144ff3bc3eae8</id>
<content type='text'>
To prevent excessive increase in preemption count
add radix_tree_preload_end in retry

Signed-off-by: Yohan Joung &lt;yohan.joung@sk.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix to recover quota data correctly</title>
<updated>2023-04-13T03:00:36Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2023-04-02T11:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1bb7d3d9cbf3ddcb8367d87b2f70757ec55f951'/>
<id>urn:sha1:e1bb7d3d9cbf3ddcb8367d87b2f70757ec55f951</id>
<content type='text'>
With -O quota mkfs option, xfstests generic/417 fails due to fsck detects
data corruption on quota inodes.

[ASSERT] (fsck_chk_quota_files:2051)  --&gt; Quota file is missing or invalid quota file content found.

The root cause is there is a hole f2fs doesn't hold quota inodes,
so all recovered quota data will be dropped due to SBI_POR_DOING
flag was set.
- f2fs_fill_super
 - f2fs_recover_orphan_inodes
  - f2fs_enable_quota_files
  - f2fs_quota_off_umount
&lt;--- quota inodes were dropped ---&gt;
 - f2fs_recover_fsync_data
  - f2fs_enable_quota_files
  - f2fs_quota_off_umount

This patch tries to eliminate the hole by holding quota inodes
during entire recovery flow as below:
- f2fs_fill_super
 - f2fs_recover_quota_begin
 - f2fs_recover_orphan_inodes
 - f2fs_recover_fsync_data
 - f2fs_recover_quota_end

Then, recovered quota data can be persisted after SBI_POR_DOING
is cleared.

Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix to drop all dirty pages during umount() if cp_error is set</title>
<updated>2023-04-10T18:03:02Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2023-04-10T02:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9b3649a934d131151111354bcbb638076f03a30'/>
<id>urn:sha1:c9b3649a934d131151111354bcbb638076f03a30</id>
<content type='text'>
xfstest generic/361 reports a bug as below:

f2fs_bug_on(sbi, sbi-&gt;fsync_node_num);

kernel BUG at fs/f2fs/super.c:1627!
RIP: 0010:f2fs_put_super+0x3a8/0x3b0
Call Trace:
 generic_shutdown_super+0x8c/0x1b0
 kill_block_super+0x2b/0x60
 kill_f2fs_super+0x87/0x110
 deactivate_locked_super+0x39/0x80
 deactivate_super+0x46/0x50
 cleanup_mnt+0x109/0x170
 __cleanup_mnt+0x16/0x20
 task_work_run+0x65/0xa0
 exit_to_user_mode_prepare+0x175/0x190
 syscall_exit_to_user_mode+0x25/0x50
 do_syscall_64+0x4c/0x90
 entry_SYSCALL_64_after_hwframe+0x72/0xdc

During umount(), if cp_error is set, f2fs_wait_on_all_pages() should
not stop waiting all F2FS_WB_CP_DATA pages to be writebacked, otherwise,
fsync_node_num can be non-zero after f2fs_wait_on_all_pages() causing
this bug.

In this case, to avoid deadloop in f2fs_wait_on_all_pages(), it needs
to drop all dirty pages rather than redirtying them.

Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: use f2fs_hw_is_readonly() instead of bdev_read_only()</title>
<updated>2023-04-10T18:00:31Z</updated>
<author>
<name>Chao Yu</name>
</author>
<published>2023-04-10T02:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68f0453dabdb99e76f75ce52ce40bc4bc71389a8'/>
<id>urn:sha1:68f0453dabdb99e76f75ce52ce40bc4bc71389a8</id>
<content type='text'>
f2fs has supported multi-device feature, to check devices' rw status,
it should use f2fs_hw_is_readonly() rather than bdev_read_only(), fix
it.

Meanwhile, it removes f2fs_hw_is_readonly() check condition in:
- f2fs_write_checkpoint()
- f2fs_convert_inline_inode()
As it has checked f2fs_readonly() condition, and if f2fs' devices
were readonly, f2fs_readonly() must be true.

Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: convert to use bitmap API</title>
<updated>2023-03-29T22:17:37Z</updated>
<author>
<name>Yangtao Li</name>
</author>
<published>2023-02-16T13:53:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=447286ebadaafa551550704ff0b42eb08b1d1cb2'/>
<id>urn:sha1:447286ebadaafa551550704ff0b42eb08b1d1cb2</id>
<content type='text'>
Let's use BIT() and GENMASK() instead of open it.

Signed-off-by: Yangtao Li &lt;frank.li@vivo.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: make f2fs_sync_inode_meta() static</title>
<updated>2023-03-29T22:17:37Z</updated>
<author>
<name>Li Zetao</name>
</author>
<published>2023-02-23T01:25:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60630375064f6f5124316dc372cdbed482a11f1e'/>
<id>urn:sha1:60630375064f6f5124316dc372cdbed482a11f1e</id>
<content type='text'>
After commit 26b5a079197c ("f2fs: cleanup dirty pages if recover failed"),
f2fs_sync_inode_meta() is only used in checkpoint.c, so
f2fs_sync_inode_meta() should only be visible inside. Delete the
declaration in the header file and change f2fs_sync_inode_meta()
to static.

Signed-off-by: Li Zetao &lt;lizetao1@huawei.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
</feed>
