2014-05-29 02:55:10

by Kinglong Mee

[permalink] [raw]
Subject: [PATCH] SUNRPC: remove KERN_DEFAULT kernel loglevel from dfprintk

When debugging, rpc prints messages for dprintk(KERN_WARNING ...) as,

[ 2780.339988] ^A4nfsd: connect from unprivileged port: 0000:0000:0000:0000:0000:0000:0000:0001, port=35316

Because, it expends as printk(KERN_DEFAULT KERN_WARNING ...).

Signed-off-by: Kinglong Mee <[email protected]>
---
include/linux/sunrpc/debug.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 9385bd7..742e2ac 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -42,14 +42,14 @@ extern unsigned int nlm_debug;
# define dfprintk(fac, args...) \
do { \
ifdebug(fac) \
- printk(KERN_DEFAULT args); \
+ printk(args); \
} while (0)

# define dfprintk_rcu(fac, args...) \
do { \
ifdebug(fac) { \
rcu_read_lock(); \
- printk(KERN_DEFAULT args); \
+ printk(args); \
rcu_read_unlock(); \
} \
} while (0)
--
1.9.3



2014-05-29 03:22:54

by Kinglong Mee

[permalink] [raw]
Subject: Re: [PATCH] SUNRPC: remove KERN_DEFAULT kernel loglevel from dfprintk

On 5/29/2014 11:15, Trond Myklebust wrote:
> Nack. This is an api change...

API change ? printk ? dprintk?

>
> On May 28, 2014 10:55 PM, "Kinglong Mee" <[email protected] <mailto:[email protected]>> wrote:
>
> When debugging, rpc prints messages for dprintk(KERN_WARNING ...) as,
>
> [ 2780.339988] ^A4nfsd: connect from unprivileged port: 0000:0000:0000:0000:0000:0000:0000:0001, port=35316
>
> Because, it expends as printk(KERN_DEFAULT KERN_WARNING ...).

net/sunrpc/svcsock.c:852, and fs/nfsd/nfsfh.c:91 call dprintk as,
dprintk(KERN_WARNING ...) ---> printk(KERN_DEFAULT KERN_WARNING ...)

so that, "^A4" will be prefixed before the debugging message.

thanks,
Kinglong Mee

>
> Signed-off-by: Kinglong Mee <[email protected] <mailto:[email protected]>>
> ---
> include/linux/sunrpc/debug.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
> index 9385bd7..742e2ac 100644
> --- a/include/linux/sunrpc/debug.h
> +++ b/include/linux/sunrpc/debug.h
> @@ -42,14 +42,14 @@ extern unsigned int nlm_debug;
> # define dfprintk(fac, args...) \
> do { \
> ifdebug(fac) \
> - printk(KERN_DEFAULT args); \
> + printk(args); \
> } while (0)
>
> # define dfprintk_rcu(fac, args...) \
> do { \
> ifdebug(fac) { \
> rcu_read_lock(); \
> - printk(KERN_DEFAULT args); \
> + printk(args); \
> rcu_read_unlock(); \
> } \
> } while (0)
> --
> 1.9.3
>