Date: | 2010-05-07 11:44:26 (13 years 4 months ago) |
---|---|
Author: | NeilBrown |
Commit: | 1176568de7e066c0be9e46c37503b9fd4730edcf |
Message: | md: restore ability of spare drives to spin down. Some time ago we stopped the clean/active metadata updates from being written to a 'spare' device in most cases so that it could spin down and say spun down. Device failure/removal etc are still recorded on spares. However commit 51d5668cb2e3fd1827a55 broke this 50% of the time, depending on whether the event count is even or odd. The change log entry said: This means that the alignment between 'odd/even' and 'clean/dirty' might take a little longer to attain, how ever the code makes no attempt to create that alignment, so it could take arbitrarily long. So when we find that clean/dirty is not aligned with odd/even, force a second metadata-update immediately. There are already cases where a second metadata-update is needed immediately (e.g. when a device fails during the metadata update). We just piggy-back on that. Reported-by: Joe Bryant <tenminjoe@yahoo.com> Signed-off-by: NeilBrown <neilb@suse.de> Cc: stable@kernel.org |
Files: |
drivers/md/md.c (1 diff) |
Change Details
drivers/md/md.c | ||
---|---|---|
2109 | 2109 | if (!mddev->in_sync || mddev->recovery_cp != MaxSector) { /* not clean */ |
2110 | 2110 | /* .. if the array isn't clean, an 'even' event must also go |
2111 | 2111 | * to spares. */ |
2112 | if ((mddev->events&1)==0) | |
2112 | if ((mddev->events&1)==0) { | |
2113 | 2113 | nospares = 0; |
2114 | sync_req = 2; /* force a second update to get the | |
2115 | * even/odd in sync */ | |
2116 | } | |
2114 | 2117 | } else { |
2115 | 2118 | /* otherwise an 'odd' event must go to spares */ |
2116 | if ((mddev->events&1)) | |
2119 | if ((mddev->events&1)) { | |
2117 | 2120 | nospares = 0; |
2121 | sync_req = 2; /* force a second update to get the | |
2122 | * even/odd in sync */ | |
2123 | } | |
2118 | 2124 | } |
2119 | 2125 | } |
2120 | 2126 |
Branches:
ben-wpan
ben-wpan-stefan
5396a9238205f20f811ea57898980d3ca82df0b6
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9