mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* typo in raid[456] kernel code/no change based on type?
@ 2008-11-12 23:58 Justin Piszcz
  2008-11-12 23:58 ` Justin Piszcz
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Piszcz @ 2008-11-12 23:58 UTC (permalink / raw)
  To: linux-kernel

$ cat /proc/mdstat 
Personalities : [raid1] [raid6] [raid5] [raid4] 
md1 : active raid1 sdb2[1] sda2[0]
       136448 blocks [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
       276109056 blocks [2/2] [UU]

md3 : active raid6 sdj1[10] sdc1[4] sdl1[8] sdk1[1] sdi1[9] sdh1[7] sdg1[6] sdf1[3] sde1[2] sdd1[0]
       2344263680 blocks level 6, 1024k chunk, algorithm 2 [10/9] [UUUUU_UUUU]
       [===================>.]  recovery = 99.1% (290466636/293032960) finish=0.6min speed=67979K/sec

md0 : active raid1 sdb1[1] sda1[0]
       16787776 blocks [2/2] [UU]

unused devices: <none>

--

But in the kernel logs:

[ 3497.577716] md: recovery of RAID array md3
[ 3497.577720] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
[ 3497.577721] md: using maximum available idle IO bandwidth (but not more than 90000 KB/sec) for recovery.
[ 3497.577728] md: using 128k window, over a total of 293032960 blocks.
[ 6981.488528] md: md3: recovery done.
[ 6982.273208] RAID5 conf printout:
                ^^^^^
[ 6982.273215]  --- rd:10 wd:10
[ 6982.273219]  disk 0, o:1, dev:sdd1
[ 6982.273223]  disk 1, o:1, dev:sdk1
[ 6982.273227]  disk 2, o:1, dev:sde1
[ 6982.273231]  disk 3, o:1, dev:sdf1
[ 6982.273245]  disk 4, o:1, dev:sdc1
[ 6982.273258]  disk 5, o:1, dev:sdj1
[ 6982.273260]  disk 6, o:1, dev:sdg1
[ 6982.273263]  disk 7, o:1, dev:sdh1
[ 6982.273265]  disk 8, o:1, dev:sdl1
[ 6982.273267]  disk 9, o:1, dev:sdi1

Is the type detectable via auto-assemble, if it is shouldn't it print out
the right raid type in the logs/dmesg?

Justin.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: typo in raid[456] kernel code/no change based on type?
  2008-11-12 23:58 typo in raid[456] kernel code/no change based on type? Justin Piszcz
@ 2008-11-12 23:58 ` Justin Piszcz
  2008-11-14 12:19   ` Andre Noll
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Piszcz @ 2008-11-12 23:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-raid



On Wed, 12 Nov 2008, Justin Piszcz wrote:

> $ cat /proc/mdstat Personalities : [raid1] [raid6] [raid5] [raid4] md1 : 
> active raid1 sdb2[1] sda2[0]
>      136448 blocks [2/2] [UU]
>
> md2 : active raid1 sdb3[1] sda3[0]
>      276109056 blocks [2/2] [UU]
>
> md3 : active raid6 sdj1[10] sdc1[4] sdl1[8] sdk1[1] sdi1[9] sdh1[7] sdg1[6] 
> sdf1[3] sde1[2] sdd1[0]
>      2344263680 blocks level 6, 1024k chunk, algorithm 2 [10/9] [UUUUU_UUUU]
>      [===================>.]  recovery = 99.1% (290466636/293032960) 
> finish=0.6min speed=67979K/sec
>
> md0 : active raid1 sdb1[1] sda1[0]
>      16787776 blocks [2/2] [UU]
>
> unused devices: <none>
>
> --
>
> But in the kernel logs:
>
> [ 3497.577716] md: recovery of RAID array md3
> [ 3497.577720] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
> [ 3497.577721] md: using maximum available idle IO bandwidth (but not more 
> than 90000 KB/sec) for recovery.
> [ 3497.577728] md: using 128k window, over a total of 293032960 blocks.
> [ 6981.488528] md: md3: recovery done.
> [ 6982.273208] RAID5 conf printout:
>               ^^^^^
> [ 6982.273215]  --- rd:10 wd:10
> [ 6982.273219]  disk 0, o:1, dev:sdd1
> [ 6982.273223]  disk 1, o:1, dev:sdk1
> [ 6982.273227]  disk 2, o:1, dev:sde1
> [ 6982.273231]  disk 3, o:1, dev:sdf1
> [ 6982.273245]  disk 4, o:1, dev:sdc1
> [ 6982.273258]  disk 5, o:1, dev:sdj1
> [ 6982.273260]  disk 6, o:1, dev:sdg1
> [ 6982.273263]  disk 7, o:1, dev:sdh1
> [ 6982.273265]  disk 8, o:1, dev:sdl1
> [ 6982.273267]  disk 9, o:1, dev:sdi1
>
> Is the type detectable via auto-assemble, if it is shouldn't it print out
> the right raid type in the logs/dmesg?
>
> Justin.
>
>

Forgot to cc linux-raid.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: typo in raid[456] kernel code/no change based on type?
  2008-11-12 23:58 ` Justin Piszcz
@ 2008-11-14 12:19   ` Andre Noll
  2008-11-14 13:05     ` Justin Piszcz
  0 siblings, 1 reply; 5+ messages in thread
From: Andre Noll @ 2008-11-14 12:19 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: linux-kernel, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]

On 18:58, Justin Piszcz wrote:

> >md3 : active raid6 sdj1[10] sdc1[4] sdl1[8] sdk1[1] sdi1[9] sdh1[7] 

[snip]

> >[ 6982.273208] RAID5 conf printout:
> >              ^^^^^

Please try the patch below which fixes this inconsistency.

Andre

commit 6c2f32376c59f08a893cd4736d92f000618dd88f
Author: Andre Noll <maan@systemlinux.org>
Date:   Fri Nov 14 13:31:56 2008 +0100

    Improve raid printout for raid levels 4 and 6.
    
    As noted by Justin Piszcz we currently log a "RAID5 conf printout:" message
    also for raid4 and raid6 arrays. This trivial patch prints the correct raid
    level, adds KERN_INFO to all printk's in print_raid5_conf() and fixes a minor
    coding style issue.
    
    Signed-off-by: Andre Noll <maan@systemlinux.org>

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a36a743..7920b26 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4343,24 +4343,24 @@ static void status(struct seq_file *seq, mddev_t *mddev)
 #endif
 }
 
-static void print_raid5_conf (raid5_conf_t *conf)
+static void print_raid5_conf(raid5_conf_t *conf)
 {
 	int i;
 	struct disk_info *tmp;
 
-	printk("RAID5 conf printout:\n");
 	if (!conf) {
-		printk("(conf==NULL)\n");
+		printk(KERN_INFO "RAID 4/5/6: (conf==NULL)\n");
 		return;
 	}
-	printk(" --- rd:%d wd:%d\n", conf->raid_disks,
-		 conf->raid_disks - conf->mddev->degraded);
+	printk(KERN_INFO "RAID%d printout:\n", conf->level);
+	printk(KERN_INFO " --- rd:%d wd:%d\n", conf->raid_disks,
+		conf->raid_disks - conf->mddev->degraded);
 
 	for (i = 0; i < conf->raid_disks; i++) {
 		char b[BDEVNAME_SIZE];
 		tmp = conf->disks + i;
 		if (tmp->rdev)
-		printk(" disk %d, o:%d, dev:%s\n",
+		printk(KERN_INFO " disk %d, o:%d, dev:%s\n",
 			i, !test_bit(Faulty, &tmp->rdev->flags),
 			bdevname(tmp->rdev->bdev,b));
 	}
-- 
The only person who always got his work done by Friday was Robinson Crusoe

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: typo in raid[456] kernel code/no change based on type?
  2008-11-14 12:19   ` Andre Noll
@ 2008-11-14 13:05     ` Justin Piszcz
  2008-11-14 17:53       ` Andre Noll
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Piszcz @ 2008-11-14 13:05 UTC (permalink / raw)
  To: Andre Noll; +Cc: linux-kernel, linux-raid



On Fri, 14 Nov 2008, Andre Noll wrote:

> On 18:58, Justin Piszcz wrote:
>
> Please try the patch below which fixes this inconsistency.
>
> Andre
>
> commit 6c2f32376c59f08a893cd4736d92f000618dd88f
> Author: Andre Noll <maan@systemlinux.org>
> Date:   Fri Nov 14 13:31:56 2008 +0100
>
>    Improve raid printout for raid levels 4 and 6.
>
>    As noted by Justin Piszcz we currently log a "RAID5 conf printout:" message
>    also for raid4 and raid6 arrays. This trivial patch prints the correct raid
>    level, adds KERN_INFO to all printk's in print_raid5_conf() and fixes a minor
>    coding style issue.
>
>    Signed-off-by: Andre Noll <maan@systemlinux.org>

[ patch ]

# patch -p1 < /home/jpiszcz/patch 
patching file drivers/md/raid5.c
Hunk #1 succeeded at 4302 (offset -41 lines).

Ok, fixed some of them but not all:

before (vanilla 2.6.27.5/6):

[   21.404744] raid5: allocated 10568kB for md3
[   21.406935] raid5: raid level 6 set md3 active with 8 out of 10 devices, algo
rithm 2
[   21.409239] RAID5 conf printout:
                ^^^^^
[   21.411544]  --- rd:10 wd:8
[   21.413812]  disk 0, o:1, dev:sdd1
[   21.416068]  disk 1, o:1, dev:sdk1
[   21.418345]  disk 2, o:1, dev:sde1
[   21.420621]  disk 3, o:1, dev:sdf1
[   21.422836]  disk 6, o:1, dev:sdg1
[   21.424941]  disk 7, o:1, dev:sdh1
[   21.426926]  disk 8, o:1, dev:sdl1
[   21.428824]  disk 9, o:1, dev:sdi1

after: (with your patch):

[   21.430884] raid5: allocated 10568kB for md3
[   21.433023] raid5: raid level 6 set md3 active with 10 out of 10 devices, algorithm 2
[   21.435236] RAID6 printout:
                ^^^^^ patch fixed this one, but it still says raid5 in other
                      parts of the code
[   21.437316]  --- rd:10 wd:10
[   21.439291]  disk 0, o:1, dev:sdd1
[   21.441204]  disk 1, o:1, dev:sdk1
[   21.443013]  disk 2, o:1, dev:sde1
[   21.444749]  disk 3, o:1, dev:sdf1
[   21.446383]  disk 4, o:1, dev:sdc1
[   21.447937]  disk 5, o:1, dev:sdj1
[   21.449444]  disk 6, o:1, dev:sdg1
[   21.450873]  disk 7, o:1, dev:sdh1
[   21.452276]  disk 8, o:1, dev:sdl1
[   21.453618]  disk 9, o:1, dev:sdi1

Here is the current output that still contains 'raid5':

$ dmesg | grep -i raid5
[   19.881548] md: raid5 personality registered for level 5
[   21.408354] raid5: device sdl1 operational as raid disk 8
[   21.410583] raid5: device sdk1 operational as raid disk 1
[   21.412789] raid5: device sdj1 operational as raid disk 5
[   21.414994] raid5: device sdi1 operational as raid disk 9
[   21.417217] raid5: device sdh1 operational as raid disk 7
[   21.419420] raid5: device sdg1 operational as raid disk 6
[   21.421622] raid5: device sdf1 operational as raid disk 3
[   21.423810] raid5: device sde1 operational as raid disk 2
[   21.425970] raid5: device sdd1 operational as raid disk 0
[   21.428090] raid5: device sdc1 operational as raid disk 4
[   21.430884] raid5: allocated 10568kB for md3
[   21.433023] raid5: raid level 6 set md3 active with 10 out of 10 devices, algorithm 2


Justin.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: typo in raid[456] kernel code/no change based on type?
  2008-11-14 13:05     ` Justin Piszcz
@ 2008-11-14 17:53       ` Andre Noll
  0 siblings, 0 replies; 5+ messages in thread
From: Andre Noll @ 2008-11-14 17:53 UTC (permalink / raw)
  To: Justin Piszcz; +Cc: linux-kernel, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

On 08:05, Justin Piszcz wrote:
> [ patch ]
> 
> # patch -p1 < /home/jpiszcz/patch 
> patching file drivers/md/raid5.c
> Hunk #1 succeeded at 4302 (offset -41 lines).
> 
> Ok, fixed some of them but not all:

Sure. The main part of the raid 4/5/6 code is in the single file raid5.c
which frequently calls all its supported raid levels "raid5". The patch
I've posted only cleans up one function in that file.

> Here is the current output that still contains 'raid5':
> 
> $ dmesg | grep -i raid5
> [   19.881548] md: raid5 personality registered for level 5
> [   21.408354] raid5: device sdl1 operational as raid disk 8
> [   21.410583] raid5: device sdk1 operational as raid disk 1
> [   21.412789] raid5: device sdj1 operational as raid disk 5
> [   21.414994] raid5: device sdi1 operational as raid disk 9
> [   21.417217] raid5: device sdh1 operational as raid disk 7
> [   21.419420] raid5: device sdg1 operational as raid disk 6
> [   21.421622] raid5: device sdf1 operational as raid disk 3
> [   21.423810] raid5: device sde1 operational as raid disk 2
> [   21.425970] raid5: device sdd1 operational as raid disk 0
> [   21.428090] raid5: device sdc1 operational as raid disk 4
> [   21.430884] raid5: allocated 10568kB for md3
> [   21.433023] raid5: raid level 6 set md3 active with 10 out of 10 
> devices, algorithm 2

Of course these can also be fixed easily. But let's first see whether
Neil wants to take such trivial stuff ATM.

Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-14 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-12 23:58 typo in raid[456] kernel code/no change based on type? Justin Piszcz
2008-11-12 23:58 ` Justin Piszcz
2008-11-14 12:19   ` Andre Noll
2008-11-14 13:05     ` Justin Piszcz
2008-11-14 17:53       ` Andre Noll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®