diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:16:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:16:17 -0400 |
| commit | f1e9a236e5ddab6c349611ee86f54291916f226c (patch) | |
| tree | be3a2ede1b6c09793403f50a02729563b512ab45 | |
| parent | 2e1deaad1e48453cea782854ab87df3f78c121c2 (diff) | |
| parent | 32f9f570d04461a41bdcd5c1d93b41ebc5ce182a (diff) | |
Merge tag 'md-3.10' of git://neil.brown.name/md
Pull md fixes from NeilBrown:
"A mixed bag of little fixes. No real new functionality here. Several
patches are tagged for -stable."
* tag 'md-3.10' of git://neil.brown.name/md:
MD: ignore discard request for hard disks of hybid raid1/raid10 array
md: bad block list should default to disabled.
md: raid1/raid10 md devices leak memory when stopping
DM RAID: Add message/status support for changing sync action
MD: Export 'md_reap_sync_thread' function
md: don't update metadata when stopping a read-only array.
md: Allow devices to be re-added to a read-only array.
md/raid10: Allow skipping recovery when clean arrays are assembled
MD: Fix typos in MD documentation
md/raid5: avoid an extra write when writing to a known-bad-block.
md/raid5: Change or of some order to improve efficiency.
md: use set_bit_le and clear_bit_le
md: HOT_DISK_REMOVE shouldn't make a read-auto device active.
md: use common code for all calls to ->hot_remove_disk()
md: never update metadata when array is read-only.
| -rw-r--r-- | Documentation/device-mapper/dm-raid.txt | 84 | ||||
| -rw-r--r-- | Documentation/md.txt | 16 | ||||
| -rw-r--r-- | drivers/md/bitmap.c | 4 | ||||
| -rw-r--r-- | drivers/md/dm-raid.c | 111 | ||||
| -rw-r--r-- | drivers/md/md.c | 235 | ||||
| -rw-r--r-- | drivers/md/md.h | 1 | ||||
| -rw-r--r-- | drivers/md/raid1.c | 8 | ||||
| -rw-r--r-- | drivers/md/raid10.c | 24 | ||||
| -rw-r--r-- | drivers/md/raid5.c | 16 |
9 files changed, 368 insertions, 131 deletions
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt index b428556197c9..e9192283e5a5 100644 --- a/Documentation/device-mapper/dm-raid.txt +++ b/Documentation/device-mapper/dm-raid.txt | |||
| @@ -1,10 +1,13 @@ | |||
| 1 | dm-raid | 1 | dm-raid |
| 2 | ------- | 2 | ======= |
| 3 | 3 | ||
| 4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. | 4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. |
| 5 | It allows the MD RAID drivers to be accessed using a device-mapper | 5 | It allows the MD RAID drivers to be accessed using a device-mapper |
| 6 | interface. | 6 | interface. |
| 7 | 7 | ||
| 8 | |||
| 9 | Mapping Table Interface | ||
| 10 | ----------------------- | ||
| 8 | The target is named "raid" and it accepts the following parameters: | 11 | The target is named "raid" and it accepts the following parameters: |
| 9 | 12 | ||
| 10 | <raid_type> <#raid_params> <raid_params> \ | 13 | <raid_type> <#raid_params> <raid_params> \ |
| @@ -47,7 +50,7 @@ The target is named "raid" and it accepts the following parameters: | |||
| 47 | followed by optional parameters (in any order): | 50 | followed by optional parameters (in any order): |
| 48 | [sync|nosync] Force or prevent RAID initialization. | 51 | [sync|nosync] Force or prevent RAID initialization. |
| 49 | 52 | ||
| 50 | [rebuild <idx>] Rebuild drive number idx (first drive is 0). | 53 | [rebuild <idx>] Rebuild drive number 'idx' (first drive is 0). |
| 51 | 54 | ||
| 52 | [daemon_sleep <ms>] | 55 | [daemon_sleep <ms>] |
| 53 | Interval between runs of the bitmap daemon that | 56 | Interval between runs of the bitmap daemon that |
| @@ -56,9 +59,9 @@ The target is named "raid" and it accepts the following parameters: | |||
| 56 | 59 | ||
| 57 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 60 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization |
| 58 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 61 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization |
| 59 | [write_mostly <idx>] Drive index is write-mostly | 62 | [write_mostly <idx>] Mark drive index 'idx' write-mostly. |
| 60 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | 63 | [max_write_behind <sectors>] See '--write-behind=' (man mdadm) |
| 61 | [stripe_cache <sectors>] Stripe cache size (higher RAIDs only) | 64 | [stripe_cache <sectors>] Stripe cache size (RAID 4/5/6 only) |
| 62 | [region_size <sectors>] | 65 | [region_size <sectors>] |
| 63 | The region_size multiplied by the number of regions is the | 66 | The region_size multiplied by the number of regions is the |
| 64 | logical size of the array. The bitmap records the device | 67 | logical size of the array. The bitmap records the device |
| @@ -122,7 +125,7 @@ The target is named "raid" and it accepts the following parameters: | |||
| 122 | given for both the metadata and data drives for a given position. | 125 | given for both the metadata and data drives for a given position. |
| 123 | 126 | ||
| 124 | 127 | ||
| 125 | Example tables | 128 | Example Tables |
| 126 | -------------- | 129 | -------------- |
| 127 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | 130 | # RAID4 - 4 data drives, 1 parity (no metadata devices) |
| 128 | # No metadata devices specified to hold superblock/bitmap info | 131 | # No metadata devices specified to hold superblock/bitmap info |
| @@ -141,26 +144,70 @@ Example tables | |||
| 141 | raid4 4 2048 sync min_recovery_rate 20 \ | 144 | raid4 4 2048 sync min_recovery_rate 20 \ |
| 142 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 | 145 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 |
| 143 | 146 | ||
| 147 | |||
| 148 | Status Output | ||
| 149 | ------------- | ||
| 144 | 'dmsetup table' displays the table used to construct the mapping. | 150 | 'dmsetup table' displays the table used to construct the mapping. |
| 145 | The optional parameters are always printed in the order listed | 151 | The optional parameters are always printed in the order listed |
| 146 | above with "sync" or "nosync" always output ahead of the other | 152 | above with "sync" or "nosync" always output ahead of the other |
| 147 | arguments, regardless of the order used when originally loading the table. | 153 | arguments, regardless of the order used when originally loading the table. |
| 148 | Arguments that can be repeated are ordered by value. | 154 | Arguments that can be repeated are ordered by value. |
| 149 | 155 | ||
| 150 | 'dmsetup status' yields information on the state and health of the | 156 | |
| 151 | array. | 157 | 'dmsetup status' yields information on the state and health of the array. |
| 152 | The output is as follows: | 158 | The output is as follows (normally a single line, but expanded here for |
| 159 | clarity): | ||
| 153 | 1: <s> <l> raid \ | 160 | 1: <s> <l> raid \ |
| 154 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> | 161 | 2: <raid_type> <#devices> <health_chars> \ |
| 162 | 3: <sync_ratio> <sync_action> <mismatch_cnt> | ||
| 155 | 163 | ||
| 156 | Line 1 is the standard output produced by device-mapper. | 164 | Line 1 is the standard output produced by device-mapper. |
| 157 | Line 2 is produced by the raid target, and best explained by example: | 165 | Line 2 & 3 are produced by the raid target and are best explained by example: |
| 158 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 | 166 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 init 0 |
| 159 | Here we can see the RAID type is raid4, there are 5 devices - all of | 167 | Here we can see the RAID type is raid4, there are 5 devices - all of |
| 160 | which are 'A'live, and the array is 2/490221568 complete with recovery. | 168 | which are 'A'live, and the array is 2/490221568 complete with its initial |
| 161 | Faulty or missing devices are marked 'D'. Devices that are out-of-sync | 169 | recovery. Here is a fuller description of the individual fields: |
| 162 | are marked 'a'. | 170 | <raid_type> Same as the <raid_type> used to create the array. |
| 163 | 171 | <health_chars> One char for each device, indicating: 'A' = alive and | |
| 172 | in-sync, 'a' = alive but not in-sync, 'D' = dead/failed. | ||
| 173 | <sync_ratio> The ratio indicating how much of the array has undergone | ||
| 174 | the process described by 'sync_action'. If the | ||
| 175 | 'sync_action' is "check" or "repair", then the process | ||
| 176 | of "resync" or "recover" can be considered complete. | ||
| 177 | <sync_action> One of the following possible states: | ||
| 178 | idle - No synchronization action is being performed. | ||
| 179 | frozen - The current action has been halted. | ||
| 180 | resync - Array is undergoing its initial synchronization | ||
| 181 | or is resynchronizing after an unclean shutdown | ||
| 182 | (possibly aided by a bitmap). | ||
| 183 | recover - A device in the array is being rebuilt or | ||
| 184 | replaced. | ||
| 185 | check - A user-initiated full check of the array is | ||
| 186 | being performed. All blocks are read and | ||
| 187 | checked for consistency. The number of | ||
| 188 | discrepancies found are recorded in | ||
| 189 | <mismatch_cnt>. No changes are made to the | ||
| 190 | array by this action. | ||
| 191 | repair - The same as "check", but discrepancies are | ||
| 192 | corrected. | ||
| 193 | reshape - The array is undergoing a reshape. | ||
| 194 | <mismatch_cnt> The number of discrepancies found between mirror copies | ||
| 195 | in RAID1/10 or wrong parity values found in RAID4/5/6. | ||
| 196 | This value is valid only after a "check" of the array | ||
| 197 | is performed. A healthy array has a 'mismatch_cnt' of 0. | ||
| 198 | |||
| 199 | Message Interface | ||
| 200 | ----------------- | ||
| 201 | The dm-raid target will accept certain actions through the 'message' interface. | ||
| 202 | ('man dmsetup' for more information on the message interface.) These actions | ||
| 203 | include: | ||
| 204 | "idle" - Halt the current sync action. | ||
| 205 | "frozen" - Freeze the current sync action. | ||
| 206 | "resync" - Initiate/continue a resync. | ||
| 207 | "recover"- Initiate/continue a recover process. | ||
| 208 | "check" - Initiate a check (i.e. a "scrub") of the array. | ||
| 209 | "repair" - Initiate a repair of the array. | ||
| 210 | "reshape"- Currently unsupported (-EINVAL). | ||
| 164 | 211 | ||
| 165 | Version History | 212 | Version History |
| 166 | --------------- | 213 | --------------- |
| @@ -171,4 +218,7 @@ Version History | |||
| 171 | 1.3.1 Allow device replacement/rebuild for RAID 10 | 218 | 1.3.1 Allow device replacement/rebuild for RAID 10 |
| 172 | 1.3.2 Fix/improve redundancy checking for RAID10 | 219 | 1.3.2 Fix/improve redundancy checking for RAID10 |
| 173 | 1.4.0 Non-functional change. Removes arg from mapping function. | 220 | 1.4.0 Non-functional change. Removes arg from mapping function. |
| 174 | 1.4.1 Add RAID10 "far" and "offset" algorithm support. | 221 | 1.4.1 RAID10 fix redundancy validation checks (commit 55ebbb5). |
| 222 | 1.4.2 Add RAID10 "far" and "offset" algorithm support. | ||
| 223 | 1.5.0 Add message interface to allow manipulation of the sync_action. | ||
| 224 | New status (STATUSTYPE_INFO) fields: sync_action and mismatch_cnt. | ||
diff --git a/Documentation/md.txt b/Documentation/md.txt index 993fba37b7d1..e0ddd327632d 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
| @@ -119,7 +119,7 @@ device to add. | |||
| 119 | The array is started with the RUN_ARRAY ioctl. | 119 | The array is started with the RUN_ARRAY ioctl. |
| 120 | 120 | ||
| 121 | Once started, new devices can be added. They should have an | 1 | |
