From: Joe Perches <joe@perches.com>
To: Anton Altaparmakov <anton@tuxera.com>
Cc: Fabian Frederick <fabf@skynet.be>,
linux-kernel <linux-kernel@vger.kernel.org>,
akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] NTFS: Logging clean-up
Date: Sun, 16 Mar 2014 09:12:50 -0700 [thread overview]
Message-ID: <1394986370.5689.17.camel@joe-AO722> (raw)
In-Reply-To: <3BC5D985-1160-4685-8656-A01350DECEBB@tuxera.com>
On Sun, 2014-03-16 at 15:53 +0000, Anton Altaparmakov wrote:
> Hi,
>
> Looks good, thanks. You can add my Acked-by if you like. Can I assume you have test it builds?
>
> Andrew, can you please merge this via your patch series? Thanks!
I think a few things need fixing first
> On 16 Mar 2014, at 12:27, Fabian Frederick <fabf@skynet.be> wrote:
>
> > -All printk(KERN_foo converted to pr_foo().
> > -Add pr_fmt and remove redundant prefixes.
I'm not sure there are "redundant prefixes"
This changes prefixes from "NTFS-fs" to "ntfs"
and should be at a minimum mentioned in the
changelog.
The va_end location needs moving.
Converting printk(KERN_DEBUG -> pr_debug will
not always emit that message now. Now, only if
DEBUG is #defined or dynamic_debugging is enabled
for the build _and_ the message is specifically
enabled will the message be output.
So, the debugging output has been silenced by default.
That's not necessarily good.
> > diff --git a/fs/ntfs/debug.c b/fs/ntfs/debug.c
[]
> > @@ -59,17 +53,15 @@ void __ntfs_warning(const char *function, const struct super_block *sb,
> > #endif
> > if (function)
> > flen = strlen(function);
> > - spin_lock(&err_buf_lock);
> > va_start(args, fmt);
> > - vsnprintf(err_buf, sizeof(err_buf), fmt, args);
> > + vaf.fmt = fmt;
> > + vaf.va = &args;
> > va_end(args);
This va_end should be moved after the pr_warns.
> > if (sb)
> > - printk(KERN_ERR "NTFS-fs warning (device %s): %s(): %s\n",
> > - sb->s_id, flen ? function : "", err_buf);
> > + pr_warn("(device %s): %s(): %pV\n",
> > + sb->s_id, flen ? function : "", &vaf);
> > else
> > - printk(KERN_ERR "NTFS-fs warning: %s(): %s\n",
> > - flen ? function : "", err_buf);
> > - spin_unlock(&err_buf_lock);
> > + pr_warn("%s(): %pV\n", flen ? function : "", &vaf);
> > }
> >
> > /**
> > @@ -94,6 +86,7 @@ void __ntfs_warning(const char *function, const struct super_block *sb,
> > void __ntfs_error(const char *function, const struct super_block *sb,
> > const char *fmt, ...)
> > {
> > + struct va_format vaf;
> > va_list args;
> > int flen = 0;
> >
> > @@ -103,17 +96,15 @@ void __ntfs_error(const char *function, const struct super_block *sb,
> > #endif
> > if (function)
> > flen = strlen(function);
> > - spin_lock(&err_buf_lock);
> > va_start(args, fmt);
> > - vsnprintf(err_buf, sizeof(err_buf), fmt, args);
> > + vaf.fmt = fmt;
> > + vaf.va = &args;
> > va_end(args);
Here too
> > if (sb)
> > - printk(KERN_ERR "NTFS-fs error (device %s): %s(): %s\n",
> > - sb->s_id, flen ? function : "", err_buf);
> > + pr_err("(device %s): %s(): %pV\n",
> > + sb->s_id, flen ? function : "", &vaf);
> > else
> > - printk(KERN_ERR "NTFS-fs error: %s(): %s\n",
> > - flen ? function : "", err_buf);
> > - spin_unlock(&err_buf_lock);
> > + pr_err("%s(): %pV\n", flen ? function : "", &vaf);
next prev parent reply other threads:[~2014-03-16 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-16 12:27 Fabian Frederick
2014-03-16 15:53 ` Anton Altaparmakov
2014-03-16 16:12 ` Joe Perches [this message]
2014-03-16 16:27 ` Anton Altaparmakov
2014-03-16 16:42 ` Joe Perches
2014-03-16 18:42 ` Fabian Frederick
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=1394986370.5689.17.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=anton@tuxera.com \
--cc=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
/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®