md: make merge_bvec_fn more robust in face of personality changes.
authorNeilBrown <neilb@suse.de>
Mon, 15 Dec 2014 01:56:57 +0000 (12:56 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 3 Feb 2015 21:35:52 +0000 (08:35 +1100)
commit64590f45ddc7147fa1968147a1f5b5c436b728fe
treec33e8ce09d739bac929e8ca943a253cb03cafd12
parent5c675f83c68fbdf9c0e103c1090b06be747fa62c
md: make merge_bvec_fn more robust in face of personality changes.

There is no locking around calls to merge_bvec_fn(), so
it is possible that calls which coincide with a level (or personality)
change could go wrong.

So create a central dispatch point for these functions and use
rcu_read_lock().
If the array is suspended, reject any merge that can be rejected.
If not, we know it is safe to call the function.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/linear.c
drivers/md/md.c
drivers/md/md.h
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c