aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorNikolay Borisov <[email protected]>2019-07-25 08:27:29 +0000
committerDavid Sterba <[email protected]>2019-07-25 15:34:08 +0000
commit6e7ca09b583de4be6c27d9d4b06e8c5dd46a58fa (patch)
treea08365bc6b1370f162158b1518061f689dc924a8 /fs/btrfs/ordered-data.c
parentbtrfs: don't leak extent_map in btrfs_get_io_geometry() (diff)
downloadkernel-6e7ca09b583de4be6c27d9d4b06e8c5dd46a58fa.tar.gz
kernel-6e7ca09b583de4be6c27d9d4b06e8c5dd46a58fa.zip
btrfs: Fix deadlock caused by missing memory barrier
Commit 06297d8cefca ("btrfs: switch extent_buffer blocking_writers from atomic to int") changed the type of blocking_writers but forgot to adjust relevant code in btrfs_tree_unlock by converting the smp_mb__after_atomic to smp_mb. This opened up the possibility of a deadlock due to re-ordering of setting blocking_writers and checking/waking up the waiter. This particular lockup is explained in a comment above waitqueue_active() function. Fix it by converting the memory barrier to a full smp_mb, accounting for the fact that blocking_writers is a simple integer. Fixes: 06297d8cefca ("btrfs: switch extent_buffer blocking_writers from atomic to int") Tested-by: Johannes Thumshirn <[email protected]> Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
0 files changed, 0 insertions, 0 deletions