]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix unprotected assignment of the left cursor for device replace
authorFilipe Manana <fdmanana@suse.com>
Sat, 14 May 2016 15:32:35 +0000 (16:32 +0100)
committerFilipe Manana <fdmanana@suse.com>
Mon, 30 May 2016 11:58:23 +0000 (12:58 +0100)
commitdc582f9272d5629bf07d7474e028efb4bf607b37
tree35fdb32b543fa5e2d3a50d51875e9c2ade2a99a4
parent22805390394db366a4ee58f94732c1c23aaf46b2
Btrfs: fix unprotected assignment of the left cursor for device replace

We were assigning new values to fields of the device replace object
without holding the respective lock after processing each device extent.
This is important for the left cursor field which can be accessed by a
concurrent task running __btrfs_map_block (which, correctly, takes the
device replace lock).
So change these fields while holding the device replace lock.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/scrub.c