<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/f2fs/node.c, branch v5.9</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>f2fs: fix indefinite loop scanning for free nid</title>
<updated>2020-09-09T03:31:33+00:00</updated>
<author>
<name>Sahitya Tummala</name>
<email>stummala@codeaurora.org</email>
</author>
<published>2020-08-18T10:10:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e2cab031ba7b5003cd12185b3ef38f1a75e3dae8'/>
<id>e2cab031ba7b5003cd12185b3ef38f1a75e3dae8</id>
<content type='text'>
If the sbi-&gt;ckpt-&gt;next_free_nid is not NAT block aligned and if there
are free nids in that NAT block between the start of the block and
next_free_nid, then those free nids will not be scanned in scan_nat_page().
This results into mismatch between nm_i-&gt;available_nids and the sum of
nm_i-&gt;free_nid_count of all NAT blocks scanned. And nm_i-&gt;available_nids
will always be greater than the sum of free nids in all the blocks.
Under this condition, if we use all the currently scanned free nids,
then it will loop forever in f2fs_alloc_nid() as nm_i-&gt;available_nids
is still not zero but nm_i-&gt;free_nid_count of that partially scanned
NAT block is zero.

Fix this to align the nm_i-&gt;next_scan_nid to the first nid of the
corresponding NAT block.

Signed-off-by: Sahitya Tummala &lt;stummala@codeaurora.org&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the sbi-&gt;ckpt-&gt;next_free_nid is not NAT block aligned and if there
are free nids in that NAT block between the start of the block and
next_free_nid, then those free nids will not be scanned in scan_nat_page().
This results into mismatch between nm_i-&gt;available_nids and the sum of
nm_i-&gt;free_nid_count of all NAT blocks scanned. And nm_i-&gt;available_nids
will always be greater than the sum of free nids in all the blocks.
Under this condition, if we use all the currently scanned free nids,
then it will loop forever in f2fs_alloc_nid() as nm_i-&gt;available_nids
is still not zero but nm_i-&gt;free_nid_count of that partially scanned
NAT block is zero.

Fix this to align the nm_i-&gt;next_scan_nid to the first nid of the
corresponding NAT block.

Signed-off-by: Sahitya Tummala &lt;stummala@codeaurora.org&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-08-23T22:36:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: space related cleanup</title>
<updated>2020-07-26T15:15:40+00:00</updated>
<author>
<name>Jack Qiu</name>
<email>jack.qiu@huawei.com</email>
</author>
<published>2020-07-24T08:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a87aff1d491f6d824d9cc53303544361d7eaae75'/>
<id>a87aff1d491f6d824d9cc53303544361d7eaae75</id>
<content type='text'>
Just for code style, no logic change
1. delete useless space
2. change spaces into tab

Signed-off-by: Jack Qiu &lt;jack.qiu@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just for code style, no logic change
1. delete useless space
2. change spaces into tab

Signed-off-by: Jack Qiu &lt;jack.qiu@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: Change the type of f2fs_flush_inline_data() to void</title>
<updated>2020-07-24T03:22:37+00:00</updated>
<author>
<name>Jia Yang</name>
<email>jiayang5@huawei.com</email>
</author>
<published>2020-07-21T03:49:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=68e79baf41f89fcdf9edf9bf3d65a71b667d066c'/>
<id>68e79baf41f89fcdf9edf9bf3d65a71b667d066c</id>
<content type='text'>
The return value of f2fs_flush_inline_data() is not used,
so delete it.

Signed-off-by: Jia Yang &lt;jiayang5@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The return value of f2fs_flush_inline_data() is not used,
so delete it.

Signed-off-by: Jia Yang &lt;jiayang5@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: should avoid inode eviction in synchronous path</title>
<updated>2020-07-21T19:55:54+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2020-07-16T16:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0f3b87fb3abc42c81d76c6c5795f26dbdb2f04b'/>
<id>b0f3b87fb3abc42c81d76c6c5795f26dbdb2f04b</id>
<content type='text'>
https://bugzilla.kernel.org/show_bug.cgi?id=208565

PID: 257    TASK: ecdd0000  CPU: 0   COMMAND: "init"
  #0 [&lt;c0b420ec&gt;] (__schedule) from [&lt;c0b423c8&gt;]
  #1 [&lt;c0b423c8&gt;] (schedule) from [&lt;c0b459d4&gt;]
  #2 [&lt;c0b459d4&gt;] (rwsem_down_read_failed) from [&lt;c0b44fa0&gt;]
  #3 [&lt;c0b44fa0&gt;] (down_read) from [&lt;c044233c&gt;]
  #4 [&lt;c044233c&gt;] (f2fs_truncate_blocks) from [&lt;c0442890&gt;]
  #5 [&lt;c0442890&gt;] (f2fs_truncate) from [&lt;c044d408&gt;]
  #6 [&lt;c044d408&gt;] (f2fs_evict_inode) from [&lt;c030be18&gt;]
  #7 [&lt;c030be18&gt;] (evict) from [&lt;c030a558&gt;]
  #8 [&lt;c030a558&gt;] (iput) from [&lt;c047c600&gt;]
  #9 [&lt;c047c600&gt;] (f2fs_sync_node_pages) from [&lt;c0465414&gt;]
 #10 [&lt;c0465414&gt;] (f2fs_write_checkpoint) from [&lt;c04575f4&gt;]
 #11 [&lt;c04575f4&gt;] (f2fs_sync_fs) from [&lt;c0441918&gt;]
 #12 [&lt;c0441918&gt;] (f2fs_do_sync_file) from [&lt;c0441098&gt;]
 #13 [&lt;c0441098&gt;] (f2fs_sync_file) from [&lt;c0323fa0&gt;]
 #14 [&lt;c0323fa0&gt;] (vfs_fsync_range) from [&lt;c0324294&gt;]
 #15 [&lt;c0324294&gt;] (do_fsync) from [&lt;c0324014&gt;]
 #16 [&lt;c0324014&gt;] (sys_fsync) from [&lt;c0108bc0&gt;]

This can be caused by flush_dirty_inode() in f2fs_sync_node_pages() where
iput() requires f2fs_lock_op() again resulting in livelock.

Reported-by: Zhiguo Niu &lt;Zhiguo.Niu@unisoc.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.kernel.org/show_bug.cgi?id=208565

PID: 257    TASK: ecdd0000  CPU: 0   COMMAND: "init"
  #0 [&lt;c0b420ec&gt;] (__schedule) from [&lt;c0b423c8&gt;]
  #1 [&lt;c0b423c8&gt;] (schedule) from [&lt;c0b459d4&gt;]
  #2 [&lt;c0b459d4&gt;] (rwsem_down_read_failed) from [&lt;c0b44fa0&gt;]
  #3 [&lt;c0b44fa0&gt;] (down_read) from [&lt;c044233c&gt;]
  #4 [&lt;c044233c&gt;] (f2fs_truncate_blocks) from [&lt;c0442890&gt;]
  #5 [&lt;c0442890&gt;] (f2fs_truncate) from [&lt;c044d408&gt;]
  #6 [&lt;c044d408&gt;] (f2fs_evict_inode) from [&lt;c030be18&gt;]
  #7 [&lt;c030be18&gt;] (evict) from [&lt;c030a558&gt;]
  #8 [&lt;c030a558&gt;] (iput) from [&lt;c047c600&gt;]
  #9 [&lt;c047c600&gt;] (f2fs_sync_node_pages) from [&lt;c0465414&gt;]
 #10 [&lt;c0465414&gt;] (f2fs_write_checkpoint) from [&lt;c04575f4&gt;]
 #11 [&lt;c04575f4&gt;] (f2fs_sync_fs) from [&lt;c0441918&gt;]
 #12 [&lt;c0441918&gt;] (f2fs_do_sync_file) from [&lt;c0441098&gt;]
 #13 [&lt;c0441098&gt;] (f2fs_sync_file) from [&lt;c0323fa0&gt;]
 #14 [&lt;c0323fa0&gt;] (vfs_fsync_range) from [&lt;c0324294&gt;]
 #15 [&lt;c0324294&gt;] (do_fsync) from [&lt;c0324014&gt;]
 #16 [&lt;c0324014&gt;] (sys_fsync) from [&lt;c0108bc0&gt;]

This can be caused by flush_dirty_inode() in f2fs_sync_node_pages() where
iput() requires f2fs_lock_op() again resulting in livelock.

Reported-by: Zhiguo Niu &lt;Zhiguo.Niu@unisoc.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: fix error path in do_recover_data()</title>
<updated>2020-07-08T17:11:19+00:00</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2020-07-06T10:23:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9627a7b31f3c4ff8bc8f3be3683983ffe6eaebe6'/>
<id>9627a7b31f3c4ff8bc8f3be3683983ffe6eaebe6</id>
<content type='text'>
- don't panic kernel if f2fs_get_node_page() fails in
f2fs_recover_inline_data() or f2fs_recover_inline_xattr();
- return error number of f2fs_truncate_blocks() to
f2fs_recover_inline_data()'s caller;

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- don't panic kernel if f2fs_get_node_page() fails in
f2fs_recover_inline_data() or f2fs_recover_inline_xattr();
- return error number of f2fs_truncate_blocks() to
f2fs_recover_inline_data()'s caller;

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: lost matching-pair of trace in f2fs_truncate_inode_blocks</title>
<updated>2020-07-08T04:51:47+00:00</updated>
<author>
<name>Yubo Feng</name>
<email>fengyubo3@huawei.com</email>
</author>
<published>2020-06-20T08:39:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9039d8355d6e37647b31a42122a26f1858a2470a'/>
<id>9039d8355d6e37647b31a42122a26f1858a2470a</id>
<content type='text'>
if get_node_path() return -E2BIG and trace of
f2fs_truncate_inode_blocks_enter/exit enabled
then the matching-pair of trace_exit will lost
in log.

Signed-off-by: Yubo Feng &lt;fengyubo3@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if get_node_path() return -E2BIG and trace of
f2fs_truncate_inode_blocks_enter/exit enabled
then the matching-pair of trace_exit will lost
in log.

Signed-off-by: Yubo Feng &lt;fengyubo3@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: remove useless parameter of __insert_free_nid()</title>
<updated>2020-07-08T04:51:45+00:00</updated>
<author>
<name>Liu Song</name>
<email>liu.song11@zte.com.cn</email>
</author>
<published>2020-06-28T13:48:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b815bdc7817d5a27410a33475f3401bd47f5854e'/>
<id>b815bdc7817d5a27410a33475f3401bd47f5854e</id>
<content type='text'>
In current version, @state will only be FREE_NID. This parameter
has no real effect so remove it to keep clean.

Signed-off-by: Liu Song &lt;liu.song11@zte.com.cn&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In current version, @state will only be FREE_NID. This parameter
has no real effect so remove it to keep clean.

Signed-off-by: Liu Song &lt;liu.song11@zte.com.cn&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: don't return vmalloc() memory from f2fs_kmalloc()</title>
<updated>2020-06-09T03:34:58+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2020-06-05T04:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0b6d4ca04a86b9dababbb76e58d33c437e127b77'/>
<id>0b6d4ca04a86b9dababbb76e58d33c437e127b77</id>
<content type='text'>
kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either
kmalloc'ed or vmalloc'ed memory.  But the f2fs wrappers, f2fs_kmalloc()
and f2fs_kvmalloc(), both return both kinds of memory.

It's redundant to have two functions that do the same thing, and also
breaking the standard naming convention is causing bugs since people
assume it's safe to kfree() memory allocated by f2fs_kmalloc().  See
e.g. the various allocations in fs/f2fs/compress.c.

Fix this by making f2fs_kmalloc() just use kmalloc().  And to avoid
re-introducing the allocation failures that the vmalloc fallback was
intended to fix, convert the largest allocations to use f2fs_kvmalloc().

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
kmalloc() returns kmalloc'ed memory, and kvmalloc() returns either
kmalloc'ed or vmalloc'ed memory.  But the f2fs wrappers, f2fs_kmalloc()
and f2fs_kvmalloc(), both return both kinds of memory.

It's redundant to have two functions that do the same thing, and also
breaking the standard naming convention is causing bugs since people
assume it's safe to kfree() memory allocated by f2fs_kmalloc().  See
e.g. the various allocations in fs/f2fs/compress.c.

Fix this by making f2fs_kmalloc() just use kmalloc().  And to avoid
re-introducing the allocation failures that the vmalloc fallback was
intended to fix, convert the largest allocations to use f2fs_kvmalloc().

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: avoid inifinite loop to wait for flushing node pages at cp_error</title>
<updated>2020-05-25T03:54:34+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2020-05-19T01:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6d7c865c2714b122a940774990cfb1d87b57294a'/>
<id>6d7c865c2714b122a940774990cfb1d87b57294a</id>
<content type='text'>
Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages
in an inifinite loop. Let's drop dirty pages at umount in that case.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages
in an inifinite loop. Let's drop dirty pages at umount in that case.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
