aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-03 04:15:57 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:18 -0400
commit61df9d91e986f1314af482e7ea5f2312a6cd0d14 (patch)
treec8e21e589e75354e41089eaeb5fe0e2cb04d20d1 /drivers
parentf022b2fddd97795bc9333ffb6862eacfa95c6a95 (diff)
[PATCH] md: make messages about resync/recovery etc more specific
It is possible to request a 'check' of an md/raid array where the whole array is read and consistancies are reported. This uses the same mechanisms as 'resync' and so reports in the kernel logs that a resync is being started. This understandably confuses/worries people. Also the text in /proc/mdstat suggests a 'resync' is happen when it is just a check. This patch changes those messages to be more specific about what is happening. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b95dd8a183ec..db1ac84a739a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4641,9 +4641,11 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev)
4641 seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)", 4641 seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)",
4642 (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)? 4642 (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)?
4643 "reshape" : 4643 "reshape" :
4644 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ? 4644 (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)?
4645 "resync" : "recovery")), 4645 "check" :
4646 per_milli/10, per_milli % 10, 4646 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ?
4647 "resync" : "recovery"))),
4648 per_milli/10, per_milli % 10,
4647 (unsigned long long) resync, 4649 (unsigned long long) resync,
4648 (unsigned long long) max_blocks); 4650 (unsigned long long) max_blocks);
4649 4651
@@ -5032,6 +5034,7 @@ void md_do_sync(mddev_t *mddev)
5032 int skipped = 0; 5034 int skipped = 0;
5033 struct list_head *rtmp; 5035 struct list_head *rtmp;
5034 mdk_rdev_t *rdev; 5036 mdk_rdev_t *rdev;
5037 char *desc;
5035 5038
5036 /* just incase thread restarts... */ 5039 /* just incase thread restarts... */
5037 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) 5040 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery))
@@ -5039,6 +5042,18 @@ void md_do_sync(mddev_t *mddev)
5039 if (mddev->ro) /* never try to sync a read-only array */ 5042 if (mddev->ro) /* never try to sync a read-only array */
5040 return; 5043 return;
5041 5044
5045 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
5046 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
5047 desc = "data-check";
5048 else if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
5049 desc = "requested-resync";
5050 else
5051 desc = "resync";
5052 } else if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
5053 desc = "reshape";
5054 else
5055 desc = "recovery";
5056
5042 /* we overload curr_resync somewhat here. 5057 /* we overload curr_resync somewhat here.
5043 * 0 == not engaged in resync at all 5058 * 0 == not engaged in resync at all
5044 * 2 == checking that there is no conflict with another sync 5059 * 2 == checking that there is no conflict with another sync
@@ -5082,10 +5097,10 @@ void md_do_sync(mddev_t *mddev)
5082 prepare_to_wait(&resync_wait, &wq, TASK_UNINTERRUPTIBLE); 5097 prepare_to_wait(&resync_wait, &wq, TASK_UNINTERRUPTIBLE);
5083 if (!kthread_should_stop() && 5098 if (!kthread_should_stop() &&
5084 mddev2->curr_resync >= mddev->curr_resync) { 5099 mddev2->curr_resync >= mddev->curr_resync) {
5085 printk(KERN_INFO "md: delaying resync of %s" 5100 printk(KERN_INFO "md: delaying %s of %s"
5086 " until %s has finished resync (they" 5101 " until %s has finished (they"
5087 " share one or more physical units)\n", 5102 " share one or more physical units)\n",
5088 mdname(mddev), mdname(mddev2)); 5103 desc, mdname(mddev), mdname(mddev2));
5089 mddev_put(mddev2); 5104 mddev_put(mddev2);
5090 schedule(); 5105 schedule();
5091 finish_wait(&resync_wait, &wq); 5106 finish_wait(&resync_wait, &wq);
@@ -5121,12 +5136,12 @@ void md_do_sync(mddev_t *mddev)
5121 j = rdev->recovery_offset; 5136 j = rdev->recovery_offset;
5122 } 5137 }
5123 5138
5124 printk(KERN_INFO "md: syncing RAID array %s\n", mdname(mddev)); 5139 printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev));
5125 printk(KERN_INFO "md: minimum _guaranteed_ reconstruction speed:" 5140 printk(KERN_INFO "md: minimum _guaranteed_ speed:"
5126 " %d KB/sec/disc.\n", speed_min(mddev)); 5141 " %d KB/sec/disk.\n", speed_min(mddev));
5127 printk(KERN_INFO "md: using maximum available idle IO bandwidth " 5142 printk(KERN_INFO "md: using maximum available idle IO bandwidth "
5128 "(but not more than %d KB/sec) for reconstruction.\n", 5143 "(but not more than %d KB/sec) for %s.\n",
5129 speed_max(mddev)); 5144 speed_max(mddev), desc);
5130 5145
5131 is_mddev_idle(mddev); /* this also initializes IO event counters */ 5146 is_mddev_idle(mddev); /* this also initializes IO event counters */
5132 5147
@@ -5152,8 +5167,8 @@ void md_do_sync(mddev_t *mddev)
5152 5167
5153 if (j>2) { 5168 if (j>2) {
5154 printk(KERN_INFO 5169 printk(KERN_INFO
5155 "md: resuming recovery of %s from checkpoint.\n", 5170 "md: resuming %s of %s from checkpoint.\n",
5156 mdname(mddev)); 5171 desc, mdname(mddev));
5157 mddev->curr_resync = j; 5172 mddev->curr_resync = j;
5158 } 5173 }
5159 5174
@@ -5236,7 +5251,7 @@ void md_do_sync(mddev_t *mddev)
5236 } 5251 }
5237 } 5252 }
5238 } 5253 }
5239 printk(KERN_INFO "md: %s: sync done.\n",mdname(mddev)); 5254 printk(KERN_INFO "md: %s: %s done.\n",mdname(mddev), desc);
5240 /* 5255 /*
5241 * this also signals 'finished resyncing' to md_stop 5256 * this also signals 'finished resyncing' to md_stop
5242 */ 5257 */
@@ -5256,8 +5271,8 @@ void md_do_sync(mddev_t *mddev)
5256 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { 5271 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
5257 if (mddev->curr_resync >= mddev->recovery_cp) { 5272 if (mddev->curr_resync >= mddev->recovery_cp) {
5258 printk(KERN_INFO 5273 printk(KERN_INFO
5259 "md: checkpointing recovery of %s.\n", 5274 "md: checkpointing %s of %s.\n",
5260 mdname(mddev)); 5275 desc, mdname(mddev));
5261 mddev->recovery_cp = mddev->curr_resync; 5276 mddev->recovery_cp = mddev->curr_resync;
5262 } 5277 }
5263 } else 5278 } else