Nikolay Borisov
6e7ca09b58
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 <jthumshirn@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-25 17:34:08 +02:00
..
2019-07-04 17:26:17 +02:00
2019-04-29 19:02:44 +02:00
2019-02-25 14:13:24 +01:00
2018-04-12 16:29:46 +02:00
2019-07-01 13:34:53 +02:00
2019-07-01 13:34:53 +02:00
2019-07-02 12:30:55 +02:00
2019-07-02 12:30:55 +02:00
2019-07-01 13:35:02 +02:00
2019-07-01 13:35:02 +02:00
2018-04-12 16:29:46 +02:00
2019-07-02 12:30:51 +02:00
2019-07-02 12:30:48 +02:00
2019-04-29 19:02:52 +02:00
2019-07-04 17:26:17 +02:00
2018-04-12 16:29:46 +02:00
2019-07-04 17:26:17 +02:00
2019-07-04 17:26:17 +02:00
2019-04-29 19:02:30 +02:00
2018-10-15 17:23:33 +02:00
2019-07-04 17:26:17 +02:00
2019-07-04 17:26:17 +02:00
2019-07-01 13:34:56 +02:00
2019-04-29 19:02:43 +02:00
2019-04-29 19:02:50 +02:00
2019-07-17 17:03:33 +02:00
2019-07-01 13:35:02 +02:00
2018-10-15 17:23:25 +02:00
2018-04-12 16:29:46 +02:00
2019-07-05 18:47:57 +02:00
2019-07-04 17:26:17 +02:00
2019-04-29 19:02:38 +02:00
2019-02-25 14:13:21 +01:00
2019-07-04 17:26:18 +02:00
2019-07-01 13:35:02 +02:00
2019-07-04 17:26:17 +02:00
2019-07-04 17:26:17 +02:00
2019-04-29 19:02:46 +02:00
2019-04-29 19:02:46 +02:00
2019-04-29 19:02:46 +02:00
2019-04-29 19:02:50 +02:00
2019-07-04 17:26:17 +02:00
2018-04-12 16:29:46 +02:00
2019-07-17 17:03:28 +02:00
2019-07-04 17:26:17 +02:00
2019-07-17 17:03:30 +02:00
2019-07-25 17:34:08 +02:00
2019-02-25 14:13:28 +01:00
2019-02-25 14:13:32 +01:00
2019-07-04 17:26:17 +02:00
2018-04-12 16:29:46 +02:00
2019-07-04 17:26:17 +02:00
2019-07-01 13:35:00 +02:00
2018-04-12 16:29:51 +02:00
2019-07-02 12:30:47 +02:00
2018-04-20 19:18:16 +02:00
2019-07-02 12:30:49 +02:00
2019-04-29 19:02:54 +02:00
2019-07-02 12:30:48 +02:00
2019-02-25 14:13:39 +01:00
2019-04-30 09:26:13 -06:00
2019-07-01 13:34:58 +02:00
2018-04-12 16:29:46 +02:00
2019-06-14 17:33:46 +02:00
2019-05-07 12:48:10 -07:00
2019-04-29 19:02:49 +02:00
2019-07-04 17:26:17 +02:00
2019-07-04 17:26:18 +02:00
2019-07-02 12:30:48 +02:00
2019-07-02 12:30:49 +02:00
2018-04-12 16:29:46 +02:00
2019-07-02 12:30:53 +02:00
2019-07-02 12:30:53 +02:00
2018-08-06 13:12:43 +02:00
2019-07-02 12:30:51 +02:00
2019-07-02 12:30:51 +02:00
2018-12-17 14:51:43 +01:00
2019-07-04 17:26:17 +02:00
2019-07-04 17:26:17 +02:00
2019-07-01 13:34:55 +02:00
2019-04-29 19:02:39 +02:00
2019-02-25 14:13:27 +01:00
2019-07-02 12:30:50 +02:00
2019-04-29 19:02:41 +02:00
2018-04-12 16:29:51 +02:00
2018-04-12 16:29:46 +02:00
2019-04-29 19:02:50 +02:00
2019-07-17 17:03:36 +02:00
2019-07-02 12:30:50 +02:00
2019-06-17 16:37:17 +02:00
2019-04-29 19:02:44 +02:00
2019-02-25 14:13:32 +01:00
2019-05-28 18:54:09 +02:00