mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Yu Zhe <yuzhe@nfschina.com>, tytso@mit.edu, adilger.kernel@dilger.ca
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	liqiong@nfschina.com
Subject: Re: [PATCH] ext4: add KERN_<LEVEL> for printk()
Date: Wed, 25 May 2022 08:18:22 -0700	[thread overview]
Message-ID: <fa2a3a8041b9d814654f0dae4607e1a2f20d333d.camel@perches.com> (raw)
In-Reply-To: <20220525124816.86915-1-yuzhe@nfschina.com>

On Wed, 2022-05-25 at 05:48 -0700, Yu Zhe wrote:
> printk() should include KERN_<LEVEL> facility level, add them.

NACK.

checkpatch is just a guide.

You have to inspect the code to determine if what checkpatch emits
should be followed or ignored.

> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
[]
> @@ -628,7 +628,7 @@ static struct stats dx_show_leaf(struct inode *dir,
>  	char *base = (char *) de;
>  	struct dx_hash_info h = *hinfo;
>  
> -	printk("names: ");
> +	printk(KERN_WARNING "names: ");
>  	while ((char *) de < base + size)
>  	{
>  		if (de->inode)
> @@ -648,7 +648,7 @@ static struct stats dx_show_leaf(struct inode *dir,
>  					/* Directory is not encrypted */
>  					ext4fs_dirhash(dir, de->name,
>  						de->name_len, &h);
> -					printk("%*.s:(U)%x.%u ", len,
> +					printk(KERN_WARNING "%*.s:(U)%x.%u ", len,

_might_ use KERN_CONT, 

>  					       name, h.hash,
>  					       (unsigned) ((char *) de
>  							   - base));
> @@ -683,7 +683,7 @@ static struct stats dx_show_leaf(struct inode *dir,
>  					else
>  						ext4fs_dirhash(dir, de->name,
>  						       de->name_len, &h);
> -					printk("%*.s:(E)%x.%u ", len, name,
> +					printk(KERN_WARNING "%*.s:(E)%x.%u ", len, name,

and here, etc...

[]

> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
[]
> @@ -941,9 +941,9 @@ void __ext4_msg(struct super_block *sb,
>  	vaf.fmt = fmt;
>  	vaf.va = &args;
>  	if (sb)
> -		printk("%sEXT4-fs (%s): %pV\n", prefix, sb->s_id, &vaf);
> +		printk(KERN_WARNING "%sEXT4-fs (%s): %pV\n", prefix, sb->s_id, &vaf);

You broke the logging here.

Did you check what prefix is and how it is used in ext4_msg ?

>  	else
> -		printk("%sEXT4-fs: %pV\n", prefix, &vaf);
> +		printk(KERN_WARNING "%sEXT4-fs: %pV\n", prefix, &vaf);
>  	va_end(args);
>  }
>  



  parent reply	other threads:[~2022-05-25 15:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 12:48 Yu Zhe
2022-05-25 15:18 ` David Laight
2022-05-25 15:18 ` Joe Perches [this message]
2022-05-25 19:25   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa2a3a8041b9d814654f0dae4607e1a2f20d333d.camel@perches.com \
    --to=joe@perches.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqiong@nfschina.com \
    --cc=tytso@mit.edu \
    --cc=yuzhe@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®