diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-03-22 14:45:05 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-05-21 18:39:03 +0200 |
| commit | 26d97047f233b13353b6e4ad91a56f5857ddf095 (patch) | |
| tree | 1654c9ecda54403cb49b510dad832e2704654c86 /include/linux/usb | |
| parent | db2d99df98b0f2264406b506cc2f1c2d2b7ce7f5 (diff) | |
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>
Diffstat (limited to 'include/linux/usb')
0 files changed, 0 insertions, 0 deletions
