<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/fs/f2fs/node.c, branch linux-5.8.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-5.8.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-5.8.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2020-09-23T10:59:52+00:00</updated>
<entry>
<title>f2fs: fix indefinite loop scanning for free nid</title>
<updated>2020-09-23T10:59:52+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.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f200e3825c349cfb590a5d7356da07eaae68ef6a'/>
<id>urn:sha1:f200e3825c349cfb590a5d7356da07eaae68ef6a</id>
<content type='text'>
[ Upstream commit e2cab031ba7b5003cd12185b3ef38f1a75e3dae8 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix error path in do_recover_data()</title>
<updated>2020-09-03T09:29: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.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7fafbbefb75802d1c179a0522565bf04e60f0966'/>
<id>urn:sha1:7fafbbefb75802d1c179a0522565bf04e60f0966</id>
<content type='text'>
[ Upstream commit 9627a7b31f3c4ff8bc8f3be3683983ffe6eaebe6 ]

- 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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: should avoid inode eviction in synchronous path</title>
<updated>2020-08-26T09:49:05+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.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f6b2fb80ffdc1509686eec9914a7a7d212bf1069'/>
<id>urn:sha1:f6b2fb80ffdc1509686eec9914a7a7d212bf1069</id>
<content type='text'>
[ Upstream commit b0f3b87fb3abc42c81d76c6c5795f26dbdb2f04b ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</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.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0b6d4ca04a86b9dababbb76e58d33c437e127b77'/>
<id>urn:sha1: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>
</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.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6d7c865c2714b122a940774990cfb1d87b57294a'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>f2fs: Avoid double lock for cp_rwsem during checkpoint</title>
<updated>2020-05-12T03:36:47+00:00</updated>
<author>
<name>Sayali Lokhande</name>
<email>sayalil@codeaurora.org</email>
</author>
<published>2020-04-30T10:58:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=34c061ad85a2f5d5e9e3b045d72f3b211db6e282'/>
<id>urn:sha1:34c061ad85a2f5d5e9e3b045d72f3b211db6e282</id>
<content type='text'>
There could be a scenario where f2fs_sync_node_pages gets
called during checkpoint, which in turn tries to flush
inline data and calls iput(). This results in deadlock as
iput() tries to hold cp_rwsem, which is already held at the
beginning by checkpoint-&gt;block_operations().

Call stack :

Thread A		Thread B
f2fs_write_checkpoint()
- block_operations(sbi)
 - f2fs_lock_all(sbi);
  - down_write(&amp;sbi-&gt;cp_rwsem);

                        - open()
                         - igrab()
                        - write() write inline data
                        - unlink()
- f2fs_sync_node_pages()
 - if (is_inline_node(page))
  - flush_inline_data()
   - ilookup()
     page = f2fs_pagecache_get_page()
     if (!page)
      goto iput_out;
     iput_out:
			-close()
			-iput()
       iput(inode);
       - f2fs_evict_inode()
        - f2fs_truncate_blocks()
         - f2fs_lock_op()
           - down_read(&amp;sbi-&gt;cp_rwsem);

Fixes: 2049d4fcb057 ("f2fs: avoid multiple node page writes due to inline_data")
Signed-off-by: Sayali Lokhande &lt;sayalil@codeaurora.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: shrink spinlock coverage</title>
<updated>2020-05-12T03:36:46+00:00</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2020-05-08T09:50:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=042be373adf719ab64c4a44ae809d110826becbf'/>
<id>urn:sha1:042be373adf719ab64c4a44ae809d110826becbf</id>
<content type='text'>
In f2fs_try_to_free_nids(), .nid_list_lock spinlock critical region will
increase as expected shrink number increase, to avoid spining other CPUs
for long time, we change to release nid caches with small batch each time
under .nid_list_lock coverage.

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: support read iostat</title>
<updated>2020-04-17T16:17:00+00:00</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2020-04-16T10:16:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8b83ac81f4283ae3bd05c9a7e15dca721014dd03'/>
<id>urn:sha1:8b83ac81f4283ae3bd05c9a7e15dca721014dd03</id>
<content type='text'>
Adds to support accounting read IOs from userspace/kernel.

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: don't trigger data flush in foreground operation</title>
<updated>2020-03-31T03:46:24+00:00</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2020-03-19T11:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7bcd0cfa735d72037c71979f18a257b0c6a2b87f'/>
<id>urn:sha1:7bcd0cfa735d72037c71979f18a257b0c6a2b87f</id>
<content type='text'>
Data flush can generate heavy IO and cause long latency during
flush, so it's not appropriate to trigger it in foreground
operation.

And also, we may face below potential deadlock during data flush:
- f2fs_write_multi_pages
 - f2fs_write_raw_pages
  - f2fs_write_single_data_page
   - f2fs_balance_fs
    - f2fs_balance_fs_bg
     - f2fs_sync_dirty_inodes
      - filemap_fdatawrite   -- stuck on flush same cluster

Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: add prefix for f2fs slab cache name</title>
<updated>2020-03-19T18:41:26+00:00</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2020-02-17T09:46:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=985100035ef5a78889bd2295d1cd91000b133846'/>
<id>urn:sha1:985100035ef5a78889bd2295d1cd91000b133846</id>
<content type='text'>
In order to avoid polluting global slab cache namespace.

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