Filipe Manana a96295965b Btrfs: fix racy system chunk allocation when setting block group ro
If while setting a block group read-only we end up allocating a system
chunk, through check_system_chunk(), we were not doing it while holding
the chunk mutex which is a problem if a concurrent chunk allocation is
happening, through do_chunk_alloc(), as it means both block groups can
end up using the same logical addresses and physical regions in the
device(s). So make sure we hold the chunk mutex.

Cc: stable@vger.kernel.org  # 4.0+
Fixes: 2f0810880f08 ("btrfs: delete chunk allocation attemp when
                      setting block group ro")

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
2015-05-19 18:04:17 -07:00
..
2015-02-16 17:56:03 -08:00
2015-03-18 10:29:48 +01:00
2015-02-15 11:11:47 -08:00
2015-02-05 16:34:25 +01:00
2014-11-19 13:01:20 -05:00
2015-02-20 04:56:44 -05:00
2015-02-16 17:56:04 -08:00
2015-01-29 00:13:13 -05:00
2014-11-19 13:01:26 -05:00