linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] treewide: convert vprintk uses to %pV
@ 2010-11-10  0:35 Joe Perches
       [not found] ` <cover.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2010-11-10  0:35 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA

Multiple secessive calls to printk can be interleaved.
Avoid this possible interleaving by using %pV

Joe Perches (9):
  drivers/gpu/drm/drm_stub.c: Use printf extension %pV
  drivers/isdn/mISDN: Use printf extension %pV
  drivers/net/wireless/ath/debug.c: Use printf extension %pV
  drivers/net/wireless/b43/main.c: Use printf extension %pV
  drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
  fs/gfs2/glock.c: Use printf extension %pV
  fs/nilfs2/super.c: Use printf extension %pV
  fs/quota/dquot.c: Use printf extension %pV
  net/sunrpc/svc.c: Use printf extension %pV

 drivers/gpu/drm/drm_stub.c            |   14 +++++++--
 drivers/isdn/mISDN/layer1.c           |   10 +++++--
 drivers/isdn/mISDN/layer2.c           |   12 ++++++--
 drivers/isdn/mISDN/tei.c              |   23 +++++++++++----
 drivers/net/wireless/ath/debug.c      |    9 +++++-
 drivers/net/wireless/b43/main.c       |   48 ++++++++++++++++++++++++--------
 drivers/net/wireless/b43legacy/main.c |   47 ++++++++++++++++++++++++--------
 fs/gfs2/glock.c                       |    9 +++++-
 fs/nilfs2/super.c                     |   23 +++++++++++-----
 fs/quota/dquot.c                      |   12 +++++---
 net/sunrpc/svc.c                      |   12 +++++---
 11 files changed, 161 insertions(+), 58 deletions(-)

-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 7/9] fs/nilfs2/super.c: Use printf extension %pV
       [not found] ` <cover.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
@ 2010-11-10  0:35   ` Joe Perches
       [not found]     ` <1addeb606bca88e09fb46b93be10c3a58e759348.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
  2010-11-10 22:48   ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2010-11-10  0:35 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: KONISHI Ryusuke, linux-nilfs-u79uwXL29TY76Z2rM5mHXA

Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 fs/nilfs2/super.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f804d41..bef8cc6 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -111,12 +111,17 @@ void nilfs_error(struct super_block *sb, const char *function,
 		 const char *fmt, ...)
 {
 	struct nilfs_sb_info *sbi = NILFS_SB(sb);
+	struct va_format vaf;
 	va_list args;
 
 	va_start(args, fmt);
-	printk(KERN_CRIT "NILFS error (device %s): %s: ", sb->s_id, function);
-	vprintk(fmt, args);
-	printk("\n");
+
+	vaf.fmt = fmt;
+	vaf.va = &args;
+
+	printk(KERN_CRIT "NILFS error (device %s): %s: %pV\n",
+	       sb->s_id, function, &vaf);
+
 	va_end(args);
 
 	if (!(sb->s_flags & MS_RDONLY)) {
@@ -136,13 +141,17 @@ void nilfs_error(struct super_block *sb, const char *function,
 void nilfs_warning(struct super_block *sb, const char *function,
 		   const char *fmt, ...)
 {
+	struct va_format vaf;
 	va_list args;
 
 	va_start(args, fmt);
-	printk(KERN_WARNING "NILFS warning (device %s): %s: ",
-	       sb->s_id, function);
-	vprintk(fmt, args);
-	printk("\n");
+
+	vaf.fmt = fmt;
+	vaf.va = &args;
+
+	printk(KERN_WARNING "NILFS warning (device %s): %s: %pV\n",
+	       sb->s_id, function, &vaf);
+
 	va_end(args);
 }
 
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/9] treewide: convert vprintk uses to %pV
       [not found] ` <cover.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
  2010-11-10  0:35   ` [PATCH 7/9] fs/nilfs2/super.c: Use printf extension %pV Joe Perches
@ 2010-11-10 22:48   ` Luis R. Rodriguez
       [not found]     ` <AANLkTinhcbdm8YQOrFVdONODo6K6PcxHYtx5vqnap_3T-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2010-11-10 22:48 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA

On Tue, Nov 9, 2010 at 4:35 PM, Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> wrote:
> Multiple secessive calls to printk can be interleaved.
> Avoid this possible interleaving by using %pV
>
> Joe Perches (9):
>  drivers/gpu/drm/drm_stub.c: Use printf extension %pV
>  drivers/isdn/mISDN: Use printf extension %pV
>  drivers/net/wireless/ath/debug.c: Use printf extension %pV
>  drivers/net/wireless/b43/main.c: Use printf extension %pV
>  drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
>  fs/gfs2/glock.c: Use printf extension %pV
>  fs/nilfs2/super.c: Use printf extension %pV
>  fs/quota/dquot.c: Use printf extension %pV
>  net/sunrpc/svc.c: Use printf extension %pV
>
>  drivers/gpu/drm/drm_stub.c            |   14 +++++++--
>  drivers/isdn/mISDN/layer1.c           |   10 +++++--
>  drivers/isdn/mISDN/layer2.c           |   12 ++++++--
>  drivers/isdn/mISDN/tei.c              |   23 +++++++++++----
>  drivers/net/wireless/ath/debug.c      |    9 +++++-
>  drivers/net/wireless/b43/main.c       |   48 ++++++++++++++++++++++++--------
>  drivers/net/wireless/b43legacy/main.c |   47 ++++++++++++++++++++++++--------
>  fs/gfs2/glock.c                       |    9 +++++-
>  fs/nilfs2/super.c                     |   23 +++++++++++-----
>  fs/quota/dquot.c                      |   12 +++++---
>  net/sunrpc/svc.c                      |   12 +++++---
>  11 files changed, 161 insertions(+), 58 deletions(-)

When was this added upstream BTW? I ask for backport considerations.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/9] treewide: convert vprintk uses to %pV
       [not found]     ` <AANLkTinhcbdm8YQOrFVdONODo6K6PcxHYtx5vqnap_3T-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-11-10 23:01       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2010-11-10 23:01 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA

On Wed, 2010-11-10 at 14:48 -0800, Luis R. Rodriguez wrote:
> When was this added upstream BTW? I ask for backport considerations.

commit 7db6f5fb65a82af03229eef104dc9899c5eecf33
Author: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Date:   Sun Jun 27 01:02:33 2010 +0000

    vsprintf: Recursive vsnprintf: Add "%pV", struct va_format
    
    Add the ability to print a format and va_list from a structure pointer
    
    Allows __dev_printk to be implemented as a single printk while
    minimizing string space duplication.
    
    %pV should not be used without some mechanism to verify the
    format and argument use ala __attribute__(format (printf(...))).
    
    Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
    Acked-by: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
    Signed-off-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 7/9] fs/nilfs2/super.c: Use printf extension %pV
       [not found]     ` <1addeb606bca88e09fb46b93be10c3a58e759348.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
@ 2010-11-11  2:38       ` Ryusuke Konishi
  0 siblings, 0 replies; 5+ messages in thread
From: Ryusuke Konishi @ 2010-11-11  2:38 UTC (permalink / raw)
  To: joe-6d6DIl74uiNBDgjK7y7TUQ
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA

On Tue,  9 Nov 2010 16:35:21 -0800, Joe Perches wrote:
> Using %pV reduces the number of printk calls and
> eliminates any possible message interleaving from
> other printk calls.
> 
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
>  fs/nilfs2/super.c |   23 ++++++++++++++++-------
>  1 files changed, 16 insertions(+), 7 deletions(-)

Applied to the nilfs tree.

Thank you.

Ryusuke Konishi
 
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index f804d41..bef8cc6 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -111,12 +111,17 @@ void nilfs_error(struct super_block *sb, const char *function,
>  		 const char *fmt, ...)
>  {
>  	struct nilfs_sb_info *sbi = NILFS_SB(sb);
> +	struct va_format vaf;
>  	va_list args;
>  
>  	va_start(args, fmt);
> -	printk(KERN_CRIT "NILFS error (device %s): %s: ", sb->s_id, function);
> -	vprintk(fmt, args);
> -	printk("\n");
> +
> +	vaf.fmt = fmt;
> +	vaf.va = &args;
> +
> +	printk(KERN_CRIT "NILFS error (device %s): %s: %pV\n",
> +	       sb->s_id, function, &vaf);
> +
>  	va_end(args);
>  
>  	if (!(sb->s_flags & MS_RDONLY)) {
> @@ -136,13 +141,17 @@ void nilfs_error(struct super_block *sb, const char *function,
>  void nilfs_warning(struct super_block *sb, const char *function,
>  		   const char *fmt, ...)
>  {
> +	struct va_format vaf;
>  	va_list args;
>  
>  	va_start(args, fmt);
> -	printk(KERN_WARNING "NILFS warning (device %s): %s: ",
> -	       sb->s_id, function);
> -	vprintk(fmt, args);
> -	printk("\n");
> +
> +	vaf.fmt = fmt;
> +	vaf.va = &args;
> +
> +	printk(KERN_WARNING "NILFS warning (device %s): %s: %pV\n",
> +	       sb->s_id, function, &vaf);
> +
>  	va_end(args);
>  }
>  
> -- 
> 1.7.3.1.g432b3.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2010-11-11  2:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10  0:35 [PATCH 0/9] treewide: convert vprintk uses to %pV Joe Perches
     [not found] ` <cover.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2010-11-10  0:35   ` [PATCH 7/9] fs/nilfs2/super.c: Use printf extension %pV Joe Perches
     [not found]     ` <1addeb606bca88e09fb46b93be10c3a58e759348.1289348757.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2010-11-11  2:38       ` Ryusuke Konishi
2010-11-10 22:48   ` [PATCH 0/9] treewide: convert vprintk uses to %pV Luis R. Rodriguez
     [not found]     ` <AANLkTinhcbdm8YQOrFVdONODo6K6PcxHYtx5vqnap_3T-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-10 23:01       ` Joe Perches

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