aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy.c
diff options
context:
space:
mode:
authorHuang Jianan <[email protected]>2021-11-18 21:58:44 +0800
committerGao Xiang <[email protected]>2021-11-23 14:58:16 +0800
commit57bbeacdbee72a54eb97d56b876cf9c94059fc34 (patch)
tree3ac13afe34eff1fb973ab3c07a08147f3a3f2c9d /lib/test_fortify/write_overflow-strncpy.c
parent136057256686de39cc3a07c2e39ef6bc43003ff6 (diff)
erofs: fix deadlock when shrink erofs slab
We observed the following deadlock in the stress test under low memory scenario: Thread A Thread B - erofs_shrink_scan - erofs_try_to_release_workgroup - erofs_workgroup_try_to_freeze -- A - z_erofs_do_read_page - z_erofs_collection_begin - z_erofs_register_collection - erofs_insert_workgroup - xa_lock(&sbi->managed_pslots) -- B - erofs_workgroup_get - erofs_wait_on_workgroup_freezed -- A - xa_erase - xa_lock(&sbi->managed_pslots) -- B To fix this, it needs to hold xa_lock before freezing the workgroup since xarray will be touched then. So let's hold the lock before accessing each workgroup, just like what we did with the radix tree before. [ Gao Xiang: Jianhua Hao also reports this issue at https://lore.kernel.org/r/[email protected] ] Link: https://lore.kernel.org/r/[email protected] Fixes: 64094a04414f ("erofs: convert workstn to XArray") Reviewed-by: Chao Yu <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Signed-off-by: Huang Jianan <[email protected]> Reported-by: Jianhua Hao <[email protected]> Signed-off-by: Gao Xiang <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy.c')
0 files changed, 0 insertions, 0 deletions