* mini change of raid5.c
@ 2011-11-09 10:05 Hardy Flor
2011-11-09 22:15 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Hardy Flor @ 2011-11-09 10:05 UTC (permalink / raw)
To: neilb; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 287 bytes --]
Hello Mr Brown,
can you please transmit this small change to the file raid5.c? There is
thus a rapid repair of a raid6 possible, using only the defective areas
must be checked. This change writes only the error position in the log
during the function "check".
Kind regards
Hardy Flor
[-- Attachment #2: raid5.c.diff --]
[-- Type: application/octet-stream, Size: 1097 bytes --]
--- raid5.c.org 2011-08-29 22:56:30.000000000 +0200
+++ raid5.c 2011-11-09 10:43:45.000000000 +0100
@@ -2738,6 +2738,11 @@
*/
set_bit(STRIPE_INSYNC, &sh->state);
else {
+ printk(KERN_WARNING
+ "md/raid:%s: mismatch (level %d) with %d disks, %lu sectors @ %llu P-Disk:%d Q-Disk:%d\n",
+ mdname(conf->mddev), conf->level,
+ conf->raid_disks, STRIPE_SECTORS, (unsigned long long) sh->sector,
+ sh->pd_idx, sh->qd_idx);
conf->mddev->resync_mismatches += STRIPE_SECTORS;
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
/* don't try to repair!! */
@@ -2890,6 +2895,11 @@
*/
}
} else {
+ printk(KERN_WARNING
+ "md/raid:%s: mismatch (level %d) with %d disks, %lu sectors @ %llu P-Disk:%d Q-Disk:%d\n",
+ mdname(conf->mddev), conf->level,
+ conf->raid_disks, STRIPE_SECTORS, (unsigned long long) sh->sector,
+ sh->pd_idx, sh->qd_idx);
conf->mddev->resync_mismatches += STRIPE_SECTORS;
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
/* don't try to repair!! */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mini change of raid5.c
2011-11-09 10:05 mini change of raid5.c Hardy Flor
@ 2011-11-09 22:15 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-11-09 22:15 UTC (permalink / raw)
To: Hardy Flor; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]
On Wed, 09 Nov 2011 11:05:01 +0100 "Hardy Flor" <Flor@ptbl-gmbh.de> wrote:
> Hello Mr Brown,
>
> can you please transmit this small change to the file raid5.c? There is
> thus a rapid repair of a raid6 possible, using only the defective areas
> must be checked. This change writes only the error position in the log
> during the function "check".
>
> Kind regards
>
> Hardy Flor
Hi Hardy,
thanks for suggesting that change.
There a couple of problems with it that would need to be fixed though.
Firstly, it print the 'Q' block for RAID5. However there is no Q block for
RAID5 so that is just distracting noise which is easy to remove.
Secondly - and more significantly - if you create a new RAID6 array with this
patch, you can expect every stripe to have incorrect parity, so you will get
a message for every single stripe which would not be good.
I don't really think that printk is the best way to get useful data from the
kernel. I would prefer that raid5 kept a list of sectors internally and made
them available through a file in sysfs. e.g. ..../md/mismatch_list.
You could then enhance raid6check.c (part of 'mdadm') to read that file and
explain exactly what is happening at each offset.
We would need to limit the number of addresses reported. If we just
allocated one page and treated it as an array of 256 64bit numbers that would
probably be sufficient.
Would you like to try coding that approach?
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-09 22:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 10:05 mini change of raid5.c Hardy Flor
2011-11-09 22:15 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).