diff options
author | NeilBrown <neilb@suse.de> | 2014-12-14 20:56:57 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-02-03 16:35:52 -0500 |
commit | 64590f45ddc7147fa1968147a1f5b5c436b728fe (patch) | |
tree | c33e8ce09d739bac929e8ca943a253cb03cafd12 /drivers/md/md.h | |
parent | 5c675f83c68fbdf9c0e103c1090b06be747fa62c (diff) |
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>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index f2602280fac1..bee5b852c33f 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -499,6 +499,10 @@ struct md_personality | |||
499 | /* congested implements bdi.congested_fn(). | 499 | /* congested implements bdi.congested_fn(). |
500 | * Will not be called while array is 'suspended' */ | 500 | * Will not be called while array is 'suspended' */ |
501 | int (*congested)(struct mddev *mddev, int bits); | 501 | int (*congested)(struct mddev *mddev, int bits); |
502 | /* mergeable_bvec is use to implement ->merge_bvec_fn */ | ||
503 | int (*mergeable_bvec)(struct mddev *mddev, | ||
504 | struct bvec_merge_data *bvm, | ||
505 | struct bio_vec *biovec); | ||
502 | }; | 506 | }; |
503 | 507 | ||
504 | struct md_sysfs_entry { | 508 | struct md_sysfs_entry { |