<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/f2fs/extent_cache.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-08-15T10:05:06+00:00</updated>
<entry>
<title>f2fs: fix KMSAN uninit-value in extent_info usage</title>
<updated>2025-08-15T10:05:06+00:00</updated>
<author>
<name>Abinash Singh</name>
<email>abinashlalotra@gmail.com</email>
</author>
<published>2025-06-25T11:05:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e68b751ec2b15d866967812c57cfdfc1eba6a269'/>
<id>urn:sha1:e68b751ec2b15d866967812c57cfdfc1eba6a269</id>
<content type='text'>
[ Upstream commit 154467f4ad033473e5c903a03e7b9bca7df9a0fa ]

KMSAN reported a use of uninitialized value in `__is_extent_mergeable()`
 and `__is_back_mergeable()` via the read extent tree path.

The root cause is that `get_read_extent_info()` only initializes three
fields (`fofs`, `blk`, `len`) of `struct extent_info`, leaving the
remaining fields uninitialized. This leads to undefined behavior
when those fields are accessed later, especially during
extent merging.

Fix it by zero-initializing the `extent_info` struct before population.

Reported-by: syzbot+b8c1d60e95df65e827d4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b8c1d60e95df65e827d4
Fixes: 94afd6d6e525 ("f2fs: extent cache: support unaligned extent")
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Abinash Singh &lt;abinashsinghlalotra@gmail.com&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 several potential integer overflows in file offsets</title>
<updated>2024-10-17T13:21:22+00:00</updated>
<author>
<name>Nikita Zhandarovich</name>
<email>n.zhandarovich@fintech.ru</email>
</author>
<published>2024-07-24T17:28:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0ae93934ce867b197fd958341c6757bcee17628'/>
<id>urn:sha1:e0ae93934ce867b197fd958341c6757bcee17628</id>
<content type='text'>
commit 1cade98cf6415897bf9342ee451cc5b40b58c638 upstream.

When dealing with large extents and calculating file offsets by
summing up according extent offsets and lengths of unsigned int type,
one may encounter possible integer overflow if the values are
big enough.

Prevent this from happening by expanding one of the addends to
(pgoff_t) type.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: d323d005ac4a ("f2fs: support file defragment")
Cc: stable@vger.kernel.org
Signed-off-by: Nikita Zhandarovich &lt;n.zhandarovich@fintech.ru&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix typos in comments</title>
<updated>2024-06-12T09:03:37+00:00</updated>
<author>
<name>Jinyoung CHOI</name>
<email>j-young.choi@samsung.com</email>
</author>
<published>2023-02-06T11:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aaeab70ad2b2bcd84985350ee6836adba7b0e254'/>
<id>urn:sha1:aaeab70ad2b2bcd84985350ee6836adba7b0e254</id>
<content type='text'>
[ Upstream commit 146949defda868378992171b9e42318b06fcd482 ]

This patch is to fix typos in f2fs files.

Signed-off-by: Jinyoung Choi &lt;j-young.choi@samsung.com&gt;
Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 278a6253a673 ("f2fs: fix to relocate check condition in f2fs_fallocate()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: inode: fix to do sanity check on extent cache correctly</title>
<updated>2023-05-17T09:53:59+00:00</updated>
<author>
<name>Chao Yu</name>
<email>chao@kernel.org</email>
</author>
<published>2023-02-07T13:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=514728ffc05b8e4ec30299c820f6186daf88b10e'/>
<id>urn:sha1:514728ffc05b8e4ec30299c820f6186daf88b10e</id>
<content type='text'>
commit 269d119481008cd725ce32553332593c0ecfc91c upstream.

In do_read_inode(), sanity check for extent cache should be called after
f2fs_init_read_extent_tree(), fix it.

Fixes: 72840cccc0a1 ("f2fs: allocate the extent_cache by default")
Signed-off-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>f2fs: factor out victim_entry usage from general rb_tree use</title>
<updated>2023-05-17T09:53:53+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2023-03-10T18:04:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cba285695872730418479bc4391d24fd69f94f9d'/>
<id>urn:sha1:cba285695872730418479bc4391d24fd69f94f9d</id>
<content type='text'>
[ Upstream commit 043d2d00b44310f84c0593c63e51fae88c829cdd ]

Let's reduce the complexity of mixed use of rb_tree in victim_entry from
extent_cache and discard_cmd.

This should fix arm32 memory alignment issue caused by shared rb_entry.

[struct victim_entry]              [struct rb_entry]
[0] struct rb_node rb_node;        [0] struct rb_node rb_node;
                                       union {
                                         struct {
                                           unsigned int ofs;
                                           unsigned int len;
                                         };
[16] unsigned long long mtime;     [12] unsigned long long key;
                                       } __packed;

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection")
Reviewed-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: allocate the extent_cache by default</title>
<updated>2023-05-17T09:53:52+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2022-12-02T21:51:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4377b1d3b19e1369d094a94596211a9815ddbb04'/>
<id>urn:sha1:4377b1d3b19e1369d094a94596211a9815ddbb04</id>
<content type='text'>
[ Upstream commit 72840cccc0a1a0a0dc1bb27b669a9111be6d0f6a ]

Let's allocate it to remove the runtime complexity.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 043d2d00b443 ("f2fs: factor out victim_entry usage from general rb_tree use")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: refactor extent_cache to support for read and more</title>
<updated>2023-05-17T09:53:52+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2022-11-30T17:26:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=33112a0a17ef87bdb3d38d4267cd287a6eeb1061'/>
<id>urn:sha1:33112a0a17ef87bdb3d38d4267cd287a6eeb1061</id>
<content type='text'>
[ Upstream commit e7547daccd6a37522f0af74ec4b5a3036f3dd328 ]

This patch prepares extent_cache to be ready for addition.

Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 043d2d00b443 ("f2fs: factor out victim_entry usage from general rb_tree use")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: remove unnecessary __init_extent_tree</title>
<updated>2023-05-17T09:53:52+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2022-11-30T18:01:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3af09dee7f9b3b50ce98387c8fa7ccaac8f54037'/>
<id>urn:sha1:3af09dee7f9b3b50ce98387c8fa7ccaac8f54037</id>
<content type='text'>
[ Upstream commit 749d543c0d451fff31e8f7a3e0a031ffcbf1ebb1 ]

Added into the caller.

Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 043d2d00b443 ("f2fs: factor out victim_entry usage from general rb_tree use")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: move internal functions into extent_cache.c</title>
<updated>2023-05-17T09:53:52+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2022-11-30T17:44:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=91b1554e66bc0deea77623c1e684f7cdda93815b'/>
<id>urn:sha1:91b1554e66bc0deea77623c1e684f7cdda93815b</id>
<content type='text'>
[ Upstream commit 3bac20a8f011b8ed4012b43f4f33010432b3c647 ]

No functional change.

Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 043d2d00b443 ("f2fs: factor out victim_entry usage from general rb_tree use")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: specify extent cache for read explicitly</title>
<updated>2023-05-17T09:53:52+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2022-11-30T17:36:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=155ff41cf28c12f02645b55d1de4314f42b2ddfb'/>
<id>urn:sha1:155ff41cf28c12f02645b55d1de4314f42b2ddfb</id>
<content type='text'>
[ Upstream commit 12607c1ba7637e750402f555b6695c50fce77a2b ]

Let's descrbie it's read extent cache.

Reviewed-by: Chao Yu &lt;chao@kernel.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Stable-dep-of: 043d2d00b443 ("f2fs: factor out victim_entry usage from general rb_tree use")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
