android_kernel_samsung_msm8976/fs/f2fs
Chao Yu 3012d2c904 f2fs: fix race condition in between free nid allocator/initializer
In below concurrent case, allocated nid can be loaded into free nid cache
and be allocated again.

Thread A				Thread B
- f2fs_create
 - f2fs_new_inode
  - alloc_nid
   - __insert_nid_to_list(ALLOC_NID_LIST)
					- f2fs_balance_fs_bg
					 - build_free_nids
					  - __build_free_nids
					   - scan_nat_page
					    - add_free_nid
					     - __lookup_nat_cache
 - f2fs_add_link
  - init_inode_metadata
   - new_inode_page
    - new_node_page
     - set_node_addr
 - alloc_nid_done
  - __remove_nid_from_list(ALLOC_NID_LIST)
					     - __insert_nid_to_list(FREE_NID_LIST)

This patch makes nat cache lookup and free nid list operation being atomical
to avoid this race condition.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-07-27 21:50:48 +02:00
..
acl.c Merge tag 'LA.BR.1.3.6-03910-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD 2017-05-26 13:28:48 +02:00
acl.h
checkpoint.c f2fs: new helper cur_cp_crc() getting crc in f2fs_checkpoint 2017-03-08 14:38:58 -08:00
data.c fscrypt: catch up to v4.11-rc1 2017-03-09 11:48:12 -08:00
debug.c f2fs: introduce free nid bitmap 2017-03-08 19:13:43 -08:00
dir.c fscrypt: catch up to v4.11-rc1 2017-03-09 11:48:12 -08:00
extent_cache.c f2fs: kill __is_extent_same 2017-03-08 14:38:35 -08:00
f2fs.h fscrypt: catch up to v4.11-rc1 2017-03-09 11:48:12 -08:00
file.c f2fs: fix an error return value in truncate_partial_data_page 2017-03-09 19:26:20 -08:00
gc.c f2fs: fix a plint compile warning 2017-03-08 19:13:50 -08:00
gc.h
hash.c
inline.c
inode.c f2fs: don't need to invalidate wrong node page 2017-03-09 19:26:29 -08:00
Kconfig
key.c
Makefile
namei.c fscrypt: catch up to v4.11-rc1 2017-03-09 11:48:12 -08:00
node.c f2fs: fix race condition in between free nid allocator/initializer 2019-07-27 21:50:48 +02:00
node.h f2fs: new helper cur_cp_crc() getting crc in f2fs_checkpoint 2017-03-08 14:38:58 -08:00
recovery.c
segment.c f2fs: don't overwrite node block by SSR 2017-03-09 19:26:40 -08:00
segment.h f2fs: update the comment of default nr_pages to skipping 2017-03-08 14:38:53 -08:00
shrinker.c
super.c UPSTREAM: f2fs: sanity check segment count 2017-09-08 18:49:20 +00:00
trace.c
trace.h
xattr.c f2fs: le16_to_cpu for xattr->e_value_size 2017-03-10 09:54:23 -08:00
xattr.h