aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-03-18 21:46:39 -0400
committerNeilBrown <neilb@suse.de>2012-03-18 21:46:39 -0400
commit050b66152f87c79e8d66aed0e7996f9336462d5f (patch)
tree44d100c2eadf2a56794e7b526abeb21d1019baa1 /drivers/md/md.h
parentba13da47ffa202784355561f72160a41350e95cc (diff)
md/raid10: handle merge_bvec_fn in member devices.
Currently we don't honour merge_bvec_fn in member devices so if there is one, we force all requests to be single-page at most. This is not ideal. So enhance the raid10 merge_bvec_fn to check that function in children as well. This introduces a small problem. There is no locking around calls the ->merge_bvec_fn and subsequent calls to ->make_request. So a device added between these could end up getting a request which violates its merge_bvec_fn. Currently the best we can do is synchronize_sched(). This will work providing no preemption happens. If there is preemption, we just have to hope that new devices are largely consistent with old devices. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 39acfe90cc26..1c2063ccf48e 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -128,6 +128,10 @@ struct md_rdev {
128enum flag_bits { 128enum flag_bits {
129 Faulty, /* device is known to have a fault */ 129 Faulty, /* device is known to have a fault */
130 In_sync, /* device is in_sync with rest of array */ 130 In_sync, /* device is in_sync with rest of array */
131 Unmerged, /* device is being added to array and should
132 * be considerred for bvec_merge_fn but not
133 * yet for actual IO
134 */
131 WriteMostly, /* Avoid reading if at all possible */ 135 WriteMostly, /* Avoid reading if at all possible */
132 AutoDetected, /* added by auto-detect */ 136 AutoDetected, /* added by auto-detect */
133 Blocked, /* An error occurred but has not yet 137 Blocked, /* An error occurred but has not yet
@@ -345,6 +349,10 @@ struct mddev {
345 int degraded; /* whether md should consider 349 int degraded; /* whether md should consider
346 * adding a spare 350 * adding a spare
347 */ 351 */
352 int merge_check_needed; /* at least one
353 * member device
354 * has a
355 * merge_bvec_fn */
348 356
349 atomic_t recovery_active; /* blocks scheduled, but not written */ 357 atomic_t recovery_active; /* blocks scheduled, but not written */
350 wait_queue_head_t recovery_wait; 358 wait_queue_head_t recovery_wait;