]> 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)
commitbf4e052da213edb87315e2ec187e1e5f9a40d4d1
tree35fdb32b543fa5e2d3a50d51875e9c2ade2a99a4
parent11b69c637b49f05ff98d7b2e058c45b110314478
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