Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499314 > unrolled thread

[PATCH] ext4: super.c: Update logging style using PR_CONT

Started byJoe Perches <joe@perches.com>
First post2016-10-12 04:10 +0200
Last post2016-10-13 02:50 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ext4: super.c: Update logging style using PR_CONT Joe Perches <joe@perches.com> - 2016-10-12 04:10 +0200
    Re: [PATCH] ext4: super.c: Update logging style using PR_CONT Jan Kara <jack@suse.cz> - 2016-10-12 12:50 +0200
      Re: [PATCH] ext4: super.c: Update logging style using PR_CONT Joe Perches <joe@perches.com> - 2016-10-12 16:40 +0200
        Re: [PATCH] ext4: super.c: Update logging style using PR_CONT Theodore Ts'o <tytso@mit.edu> - 2016-10-13 02:50 +0200

#1499314 — [PATCH] ext4: super.c: Update logging style using PR_CONT

FromJoe Perches <joe@perches.com>
Date2016-10-12 04:10 +0200
Subject[PATCH] ext4: super.c: Update logging style using PR_CONT
Message-ID<srh9v-6ic-3@gated-at.bofh.it>
Recent commit require line continuing printks to use PR_CONT.

Update super.c to use PR_CONT and use vsprintf extension %pV
to avoid a printk/vprintk/printk("\n") sequence as well.

Signed-off-by: Joe Perches <joe@perches.com>
---
 fs/ext4/super.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6db81fbcbaa6..20da99da0a34 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -597,14 +597,15 @@ void __ext4_std_error(struct super_block *sb, const char *function,
 void __ext4_abort(struct super_block *sb, const char *function,
 		unsigned int line, const char *fmt, ...)
 {
+	struct va_format vaf;
 	va_list args;
 
 	save_error_info(sb, function, line);
 	va_start(args, fmt);
-	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: ", sb->s_id,
-	       function, line);
-	vprintk(fmt, args);
-	printk("\n");
+	vaf.fmt = fmt;
+	vaf.va = &args;
+	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: %pV\n",
+	       sb->s_id, function, line, &vaf);
 	va_end(args);
 
 	if ((sb->s_flags & MS_RDONLY) == 0) {
@@ -2715,12 +2716,12 @@ static void print_daily_error_info(unsigned long arg)
 		       es->s_first_error_func,
 		       le32_to_cpu(es->s_first_error_line));
 		if (es->s_first_error_ino)
-			printk(": inode %u",
+			printk(KERN_CONT ": inode %u",
 			       le32_to_cpu(es->s_first_error_ino));
 		if (es->s_first_error_block)
-			printk(": block %llu", (unsigned long long)
+			printk(KERN_CONT ": block %llu", (unsigned long long)
 			       le64_to_cpu(es->s_first_error_block));
-		printk("\n");
+		printk(KERN_CONT "\n");
 	}
 	if (es->s_last_error_time) {
 		printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d",
@@ -2729,12 +2730,12 @@ static void print_daily_error_info(unsigned long arg)
 		       es->s_last_error_func,
 		       le32_to_cpu(es->s_last_error_line));
 		if (es->s_last_error_ino)
-			printk(": inode %u",
+			printk(KERN_CONT ": inode %u",
 			       le32_to_cpu(es->s_last_error_ino));
 		if (es->s_last_error_block)
-			printk(": block %llu", (unsigned long long)
+			printk(KERN_CONT ": block %llu", (unsigned long long)
 			       le64_to_cpu(es->s_last_error_block));
-		printk("\n");
+		printk(KERN_CONT "\n");
 	}
 	mod_timer(&sbi->s_err_report, jiffies + 24*60*60*HZ);  /* Once a day */
 }
-- 
2.10.0.rc2.1.g053435c

[toc] | [next] | [standalone]


#1499479

FromJan Kara <jack@suse.cz>
Date2016-10-12 12:50 +0200
Message-ID<srpgJ-3eb-13@gated-at.bofh.it>
In reply to#1499314
On Tue 11-10-16 18:57:58, Joe Perches wrote:
> Recent commit require line continuing printks to use PR_CONT.
> 
> Update super.c to use PR_CONT and use vsprintf extension %pV
> to avoid a printk/vprintk/printk("\n") sequence as well.

Looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  fs/ext4/super.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 6db81fbcbaa6..20da99da0a34 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -597,14 +597,15 @@ void __ext4_std_error(struct super_block *sb, const char *function,
>  void __ext4_abort(struct super_block *sb, const char *function,
>  		unsigned int line, const char *fmt, ...)
>  {
> +	struct va_format vaf;
>  	va_list args;
>  
>  	save_error_info(sb, function, line);
>  	va_start(args, fmt);
> -	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: ", sb->s_id,
> -	       function, line);
> -	vprintk(fmt, args);
> -	printk("\n");
> +	vaf.fmt = fmt;
> +	vaf.va = &args;
> +	printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: %pV\n",
> +	       sb->s_id, function, line, &vaf);
>  	va_end(args);
>  
>  	if ((sb->s_flags & MS_RDONLY) == 0) {
> @@ -2715,12 +2716,12 @@ static void print_daily_error_info(unsigned long arg)
>  		       es->s_first_error_func,
>  		       le32_to_cpu(es->s_first_error_line));
>  		if (es->s_first_error_ino)
> -			printk(": inode %u",
> +			printk(KERN_CONT ": inode %u",
>  			       le32_to_cpu(es->s_first_error_ino));
>  		if (es->s_first_error_block)
> -			printk(": block %llu", (unsigned long long)
> +			printk(KERN_CONT ": block %llu", (unsigned long long)
>  			       le64_to_cpu(es->s_first_error_block));
> -		printk("\n");
> +		printk(KERN_CONT "\n");
>  	}
>  	if (es->s_last_error_time) {
>  		printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d",
> @@ -2729,12 +2730,12 @@ static void print_daily_error_info(unsigned long arg)
>  		       es->s_last_error_func,
>  		       le32_to_cpu(es->s_last_error_line));
>  		if (es->s_last_error_ino)
> -			printk(": inode %u",
> +			printk(KERN_CONT ": inode %u",
>  			       le32_to_cpu(es->s_last_error_ino));
>  		if (es->s_last_error_block)
> -			printk(": block %llu", (unsigned long long)
> +			printk(KERN_CONT ": block %llu", (unsigned long long)
>  			       le64_to_cpu(es->s_last_error_block));
> -		printk("\n");
> +		printk(KERN_CONT "\n");
>  	}
>  	mod_timer(&sbi->s_err_report, jiffies + 24*60*60*HZ);  /* Once a day */
>  }
> -- 
> 2.10.0.rc2.1.g053435c
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

[toc] | [prev] | [next] | [standalone]


#1499726

FromJoe Perches <joe@perches.com>
Date2016-10-12 16:40 +0200
Message-ID<srsRk-5Ir-23@gated-at.bofh.it>
In reply to#1499479
On Wed, 2016-10-12 at 12:41 +0200, Jan Kara wrote:
> On Tue 11-10-16 18:57:58, Joe Perches wrote:
> > Recent commit require line continuing printks to use PR_CONT.
> > 
> > Update super.c to use PR_CONT and use vsprintf extension %pV
> > to avoid a printk/vprintk/printk("\n") sequence as well.
> 
> 
> Looks good. You can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

Except the subject and commit bodyis broken and should use KERN_CONT not PR_CONT

Ted, can you please fix when applying or do you want a resubmit?

[toc] | [prev] | [next] | [standalone]


#1499988

FromTheodore Ts'o <tytso@mit.edu>
Date2016-10-13 02:50 +0200
Message-ID<srCnD-3SP-9@gated-at.bofh.it>
In reply to#1499726
On Wed, Oct 12, 2016 at 07:32:10AM -0700, Joe Perches wrote:
> On Wed, 2016-10-12 at 12:41 +0200, Jan Kara wrote:
> > On Tue 11-10-16 18:57:58, Joe Perches wrote:
> > > Recent commit require line continuing printks to use PR_CONT.
> > > 
> > > Update super.c to use PR_CONT and use vsprintf extension %pV
> > > to avoid a printk/vprintk/printk("\n") sequence as well.
> > 
> > 
> > Looks good. You can add:
> > 
> > Reviewed-by: Jan Kara <jack@suse.cz>
> 
> Except the subject and commit bodyis broken and should use KERN_CONT not PR_CONT
> 
> Ted, can you please fix when applying or do you want a resubmit?

I'll fix it up, no worries!.

					- Ted

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web