From: Joe Perches <joe@perches.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
Eric Paris <eparis@parisplace.org>,
peter.enderborg@sony.com, selinux@tycho.nsa.gov,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selinux: Use pr_fmt to prefix "SELinux: "
Date: Mon, 02 Jul 2018 14:31:32 -0700 [thread overview]
Message-ID: <d729f7dc451cf26f5fdb63e44930c8fb67da41d3.camel@perches.com> (raw)
In-Reply-To: <CAHC9VhS_UmWfv0aFGLfaqw-fLSmoGiDEcXGFZ3bvwNgp2PF=zg@mail.gmail.com>
On Mon, 2018-07-02 at 16:51 -0400, Paul Moore wrote:
> On Wed, Jun 20, 2018 at 2:39 AM Joe Perches <joe@perches.com> wrote:
> > pr_fmt can be used with the pr_<level> macros to prefix
> > arbitrary content to logging messages.
> >
> > So add '#define pr_fmt(fmt) "SELinux: " fmt' to selinux files
> > that use pr_<level> and remove embedded "SELinux: " prefixes
> > from the format strings.
[]
> > @@ -1644,13 +1640,12 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
> >
> > if (rc == -EINVAL) {
> > if (printk_ratelimit())
> > - pr_notice("SELinux: inode=%lu on dev=%s was found to have an invalid "
> > - "context=%s. This indicates you may need to relabel the inode or the "
> > - "filesystem in question.\n", ino, dev, context);
> > + pr_notice("inode=%lu on dev=%s was found to have an invalid context=%s. This indicates you may need to relabel the inode or the filesystem in question.\n",
> > + ino, dev, context);
>
> Please split up lines like this. I realize that there isn't much room
> left, but this message wraps a silly amount in my 80-char terminal; if
> you need to wrap, please limit it to a word or two.
>
> To stop the argument before it starts, I don't care what checkpatch.pl
> says about splitting printk format strings like this.
I do, so does Linus. It's also specified in CodingStyle.
2) Breaking long lines and strings
----------------------------------
[]
never break user-visible strings such as
printk messages, because that breaks the ability to grep for them.
----------------------------------
Likely this would also use pr_notice_ratelimited(etc...)
to reduce indentation a bit too.
Probably these should be output on 2 lines as the output
dmesg line length is extremely long.
> What tree did you base your patch on?
next-20180619 on the day it was sent.
> Please base SELinux patches
> either on the SELinux tree or Linus' tree. The SELinux tree can be
> found at the links below:
>
> * git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
> * https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux.git
It's almost always better to use selinux/next.
Why should this patch be different?
cheers, Joe
next prev parent reply other threads:[~2018-07-02 21:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 6:39 Joe Perches
2018-07-02 20:51 ` Paul Moore
2018-07-02 21:31 ` Joe Perches [this message]
2018-07-03 1:15 ` Paul Moore
2018-07-03 2:10 ` Joe Perches
2018-07-03 2:41 ` Paul Moore
2018-07-03 2:58 ` Joe Perches
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=d729f7dc451cf26f5fdb63e44930c8fb67da41d3.camel@perches.com \
--to=joe@perches.com \
--cc=eparis@parisplace.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=peter.enderborg@sony.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/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®