aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-21 23:53:47 -0400
committerNeilBrown <neilb@suse.de>2012-05-21 23:53:47 -0400
commit3ea7daa5d7fde47cd41f4d56c2deb949114da9d6 (patch)
tree8b88c2f7451219cd32f32753100ffc62cbda9c60 /drivers/md/raid10.h
parentdeb200d08590622d987718135a1e6323f83154aa (diff)
md/raid10: add reshape support
A 'near' or 'offset' lay RAID10 array can be reshaped to a different 'near' or 'offset' layout, a different chunk size, and a different number of devices. However the number of copies cannot change. Unlike RAID5/6, we do not support having user-space backup data that is being relocated during a 'critical section'. Rather, the data_offset of each device must change so that when writing any block to a new location, it will not over-write any data that is still 'live'. This means that RAID10 reshape is not supportable on v0.90 metadata. The different between the old data_offset and the new_offset must be at least the larger of the chunksize multiplied by offset copies of each of the old and new layout. (for 'near' mode, offset_copies == 1). A larger difference of around 64M seems useful for in-place reshapes as more data can be moved between metadata updates. Very large differences (e.g. 512M) seem to slow the process down due to lots of long seeks (on oldish consumer graded devices at least). Metadata needs to be updated whenever the place we are about to write to is considered - by the current metadata - to still contain data in the old layout. [unbalanced locking fix from Dan Carpenter <dan.carpenter@oracle.com>] Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r--drivers/md/raid10.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 37509d7134aa..135b1b0a1554 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -14,6 +14,7 @@ struct mirror_info {
14struct r10conf { 14struct r10conf {
15 struct mddev *mddev; 15 struct mddev *mddev;
16 struct mirror_info *mirrors; 16 struct mirror_info *mirrors;
17 struct mirror_info *mirrors_new, *mirrors_old;
17 spinlock_t device_lock; 18 spinlock_t device_lock;
18 19
19 /* geometry */ 20 /* geometry */
@@ -42,6 +43,9 @@ struct r10conf {
42 sector_t dev_sectors; /* temp copy of 43 sector_t dev_sectors; /* temp copy of
43 * mddev->dev_sectors */ 44 * mddev->dev_sectors */
44 sector_t reshape_progress; 45 sector_t reshape_progress;
46 sector_t reshape_safe;
47 unsigned long reshape_checkpoint;
48 sector_t offset_diff;
45 49
46 struct list_head retry_list; 50 struct list_head retry_list;
47 /* queue pending writes and submit them on unplug */ 51 /* queue pending writes and submit them on unplug */
@@ -138,6 +142,7 @@ enum r10bio_state {
138 R10BIO_Uptodate, 142 R10BIO_Uptodate,
139 R10BIO_IsSync, 143 R10BIO_IsSync,
140 R10BIO_IsRecover, 144 R10BIO_IsRecover,
145 R10BIO_IsReshape,
141 R10BIO_Degraded, 146 R10BIO_Degraded,
142/* Set ReadError on bios that experience a read error 147/* Set ReadError on bios that experience a read error
143 * so that raid10d knows what to do with them. 148 * so that raid10d knows what to do with them.