RAID: Remove leading TAB on printk messages
PATCH 1/2 RAID: Remove leading TAB on printk messages
RAID: Remove leading TAB on printk messages
MD drivers use one printk() call to print 2 log messages and the second line may be prefixed by a TAB character. It may also output a trailing space before newline. klogd (I think) turns the TAB character into the 2 characters '^I' when logging to a file. This looks ugly.
Instead of a leading TAB to indicate continuation, prefix both output lines with 'raid:' or similar. Also remove any trailing space in the vicinity of the affected code and consistently end the sentences with a period.
---
drivers/md/multipath.c | 3 ++- drivers/md/raid1.c | 4 ++-- drivers/md/raid10.c | 4 ++-- drivers/md/raid5.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-)
drivers/md/multipath.c +2 -1
@@ -244,7 +244,8 @@ static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev) conf->working_disks--; mddev->degraded++;printk (KERN_ALERT "multipath: IO failure on %s," -" disabling IO path. \n Operation continuing" +" disabling IO path.\n" +"multipath: Operation continuing" " on %d IO paths.\n" ,bdevname (rdev->bdev,b), conf->working_disks);
drivers/md/raid1.c +2 -2
@@ -1008,8 +1008,8 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev) }else set_bit (Faulty, &rdev->flags);set_bit (MD_CHANGE_DEVS , &mddev->flags); -printk (KERN_ALERT "raid1: Disk failure on %s, disabling device. \n" -" Operation continuing on %d devices\n" , +printk (KERN_ALERT "raid1: Disk failure on %s, disabling device.\n" +"raid1: Operation continuing on %d devices.\n" ,bdevname (rdev->bdev,b), conf->raid_disks - mddev->degraded); }
drivers/md/raid10.c +2 -2
@@ -1001,8 +1001,8 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev) }set_bit (Faulty, &rdev->flags);set_bit (MD_CHANGE_DEVS , &mddev->flags); -printk (KERN_ALERT "raid10: Disk failure on %s, disabling device. \n" -" Operation continuing on %d devices\n" , +printk (KERN_ALERT "raid10: Disk failure on %s, disabling device.\n" +"raid10: Operation continuing on %d devices.\n" ,bdevname (rdev->bdev,b), conf->raid_disks - mddev->degraded); }
drivers/md/raid5.c +2 -2
@@ -1260,8 +1260,8 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev) }set_bit (Faulty, &rdev->flags);printk (KERN_ALERT -"raid5: Disk failure on %s, disabling device." -" Operation continuing on %d devices\n" , +"raid5: Disk failure on %s, disabling device.\n" +"raid5: Operation continuing on %d devices.\n" ,bdevname (rdev->bdev,b), conf->raid_disks - mddev->degraded); } }
PATCH 2/2 RAID: remove trailing space from printk line
RAID: remove trailing space from printk line
drivers/md/*.[ch] contains only one more printk line with a trailing space. Remove it.
---
drivers/md/md.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/md/md.c +1 -1
@@ -4152,7 +4152,7 @@ static int hot_remove_disk(mddev_t * mddev, dev_t dev)return 0 ; busy: -printk (KERN_WARNING "md: cannot remove active disk %s from %s ... \n" , +printk (KERN_WARNING "md: cannot remove active disk %s from %s ...\n" ,bdevname (rdev->bdev,b),mdname (mddev));return -EBUSY ; }
drivers/md/raid1.c static void error(mddev_t *mddev, mdk_rdev_t *rdev) · line 1012
Quoted 2 lines · Nick Andrew
drivers/md/raid1.c +2
-0+ printk(KERN_ALERT "raid1: Disk failure on %s, disabling device.\n" + "raid1: Operation continuing on %d devices.\n",
Note: It wasn't known at the time, but the use of a multi-line string in printk will cause one line to be emitted at KERN_ALERT level, and the subsequent lines at default_message_loglevel, which is usually something different.
My patch just posted in msg <[email protected]> resolves this problem.
Nick.
Signature · 2 lines
PGP Key ID = 0x418487E7 http://www.nick-andrew.net/ PGP Key fingerprint = B3ED 6894 8E49 1770 C24A 67E3 6266 6EB9 4184 87E7