linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: Fix single printks with multiple KERN_<level>s
       [not found]           ` <20101123223344.GE26510@n2100.arm.linux.org.uk>
@ 2010-11-24  0:57             ` Joe Perches
  2010-11-24  5:16               ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2010-11-24  0:57 UTC (permalink / raw)
  To: Neil Brown
  Cc: Russell King - ARM Linux, Linus Torvalds, linux-raid,
	linux-kernel

Noticed-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Joe Perches <joe@perches.com>
---
> Note that KERN_foo in the middle of strings, even after a newline are
> preserved in the output.  So:
> 
>                 printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory.  This leads\n"
>                        KERN_WARNING "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n"
>                        KERN_WARNING "will fail in the next kernel release.  Please fix your driver.\n");
> 
> results in <4>'s appearing on the console.  I've always written code
> over the last 15 years assuming that after any newline in printk output,
> the log level gets reset and so needs a new log level specifier.
> 
> Sounds like this is something which needs auditing as a result of your
> change, and sounds like its something that kernelnewbies people could
> do.  My own greps haven't revealed any cases though.

 drivers/md/raid1.c  |    5 +++--
 drivers/md/raid10.c |    5 +++--
 drivers/md/raid5.c  |    1 -
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 45f8324..e05381b 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1027,8 +1027,9 @@ 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 "md/raid1:%s: Disk failure on %s, disabling device.\n"
-	       KERN_ALERT "md/raid1:%s: Operation continuing on %d devices.\n",
+	printk(KERN_ALERT
+	       "md/raid1:%s: Disk failure on %s, disabling device.\n"
+	       "md/raid1:%s: Operation continuing on %d devices.\n",
 	       mdname(mddev), bdevname(rdev->bdev, b),
 	       mdname(mddev), conf->raid_disks - mddev->degraded);
 }
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index c67aa54..686543d 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1051,8 +1051,9 @@ 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 "md/raid10:%s: Disk failure on %s, disabling device.\n"
-	       KERN_ALERT "md/raid10:%s: Operation continuing on %d devices.\n",
+	printk(KERN_ALERT
+	       "md/raid10:%s: Disk failure on %s, disabling device.\n"
+	       "md/raid10:%s: Operation continuing on %d devices.\n",
 	       mdname(mddev), bdevname(rdev->bdev, b),
 	       mdname(mddev), conf->raid_disks - mddev->degraded);
 }
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index dc574f3..316fbe7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1721,7 +1721,6 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
 		set_bit(Faulty, &rdev->flags);
 		printk(KERN_ALERT
 		       "md/raid:%s: Disk failure on %s, disabling device.\n"
-		       KERN_ALERT
 		       "md/raid:%s: Operation continuing on %d devices.\n",
 		       mdname(mddev),
 		       bdevname(rdev->bdev, b),

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

* Re: [PATCH] md: Fix single printks with multiple KERN_<level>s
  2010-11-24  0:57             ` [PATCH] md: Fix single printks with multiple KERN_<level>s Joe Perches
@ 2010-11-24  5:16               ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2010-11-24  5:16 UTC (permalink / raw)
  To: Joe Perches
  Cc: Russell King - ARM Linux, Linus Torvalds, linux-raid,
	linux-kernel

On Tue, 23 Nov 2010 16:57:40 -0800
Joe Perches <joe@perches.com> wrote:

> Noticed-by: Russell King <linux@arm.linux.org.uk>
> Signed-off-by: Joe Perches <joe@perches.com>

Applied by: NeilBrown

Thanks a lot!

NeilBrown


> ---
> > Note that KERN_foo in the middle of strings, even after a newline are
> > preserved in the output.  So:
> > 
> >                 printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory.  This leads\n"
> >                        KERN_WARNING "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n"
> >                        KERN_WARNING "will fail in the next kernel release.  Please fix your driver.\n");
> > 
> > results in <4>'s appearing on the console.  I've always written code
> > over the last 15 years assuming that after any newline in printk output,
> > the log level gets reset and so needs a new log level specifier.
> > 
> > Sounds like this is something which needs auditing as a result of your
> > change, and sounds like its something that kernelnewbies people could
> > do.  My own greps haven't revealed any cases though.
> 
>  drivers/md/raid1.c  |    5 +++--
>  drivers/md/raid10.c |    5 +++--
>  drivers/md/raid5.c  |    1 -
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 45f8324..e05381b 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -1027,8 +1027,9 @@ 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 "md/raid1:%s: Disk failure on %s, disabling device.\n"
> -	       KERN_ALERT "md/raid1:%s: Operation continuing on %d devices.\n",
> +	printk(KERN_ALERT
> +	       "md/raid1:%s: Disk failure on %s, disabling device.\n"
> +	       "md/raid1:%s: Operation continuing on %d devices.\n",
>  	       mdname(mddev), bdevname(rdev->bdev, b),
>  	       mdname(mddev), conf->raid_disks - mddev->degraded);
>  }
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index c67aa54..686543d 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1051,8 +1051,9 @@ 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 "md/raid10:%s: Disk failure on %s, disabling device.\n"
> -	       KERN_ALERT "md/raid10:%s: Operation continuing on %d devices.\n",
> +	printk(KERN_ALERT
> +	       "md/raid10:%s: Disk failure on %s, disabling device.\n"
> +	       "md/raid10:%s: Operation continuing on %d devices.\n",
>  	       mdname(mddev), bdevname(rdev->bdev, b),
>  	       mdname(mddev), conf->raid_disks - mddev->degraded);
>  }
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index dc574f3..316fbe7 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -1721,7 +1721,6 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
>  		set_bit(Faulty, &rdev->flags);
>  		printk(KERN_ALERT
>  		       "md/raid:%s: Disk failure on %s, disabling device.\n"
> -		       KERN_ALERT
>  		       "md/raid:%s: Operation continuing on %d devices.\n",
>  		       mdname(mddev),
>  		       bdevname(rdev->bdev, b),
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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

end of thread, other threads:[~2010-11-24  5:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20101011152516.GF27153@n2100.arm.linux.org.uk>
     [not found] ` <1290505382-16110-1-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]   ` <20101123101210.GA18170@n2100.arm.linux.org.uk>
     [not found]     ` <20101123103940.GN4693@pengutronix.de>
     [not found]       ` <20101123105830.GO4693@pengutronix.de>
     [not found]         ` <AANLkTinmky17XZZPh7QvcY_r=66f_PwzRYFPUSvhiJGK@mail.gmail.com>
     [not found]           ` <20101123223344.GE26510@n2100.arm.linux.org.uk>
2010-11-24  0:57             ` [PATCH] md: Fix single printks with multiple KERN_<level>s Joe Perches
2010-11-24  5:16               ` Neil Brown

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).