]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs, raid56: fix use-after-free problem in the final device replace procedure on...
authorMiao Xie <miaox@cn.fujitsu.com>
Tue, 25 Nov 2014 08:39:28 +0000 (16:39 +0800)
committerMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Dec 2014 02:18:47 +0000 (10:18 +0800)
commit7e2dfb2689bccd88812ae221dad91e971b5a7035
treed3d988c61ff1dcf8fe6886e3c2ba3783814d614e
parent3da5debab649a45088dff647d32cc31f34a6ca56
Btrfs, raid56: fix use-after-free problem in the final device replace procedure on raid56

The commit 27daa39a (Btrfs: fix use-after-free in the finishing
procedure of the device replace) fixed a use-after-free problem
which happened when removing the source device at the end of device
replace, but at that time, btrfs didn't support device replace
on raid56, so we didn't fix the problem on the raid56 profile.
Currently, we implemented device replace for raid56, so we need
kick that problem out before we enable that function for raid56.

The fix method is very simple, we just increase the bio per-cpu
counter before we submit a raid56 io, and decrease the counter
when the raid56 io ends.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
fs/btrfs/ctree.h
fs/btrfs/dev-replace.c
fs/btrfs/raid56.c
fs/btrfs/raid56.h
fs/btrfs/scrub.c
fs/btrfs/volumes.c