Skip to contentSkip to conversation

SUNRPC: remove KERN_DEFAULT kernel loglevel from dfprintk

PATCH In review Kinglong Mee 1 participant 3 messages May 29, 2014 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 ...).

---
 include/linux/sunrpc/debug.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/sunrpc/debug.h +2 -2
index 9385bd7..742e2ac 100644
@@ -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)
Signature · 1 line
1.9.3
#2 lore raw
In reply to a message not in the archive
Quoted 1 line · Trond Myklebust

Nack. This is an api change...

API change ? printk ? dprintk?

Quoted 8 lines · On May 28, 2014 10:55 PM, "Kinglong Mee" <[email protected]…

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

Quoted 30 lines
    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
#4 lore raw
In reply to a message not in the archive
Quoted 9 lines · Trond Myklebust
Quoted 4 lines · On Wed, May 28, 2014 at 11:22 PM, Kinglong Mee <[email protected]…
Quoted 1 line · Trond Myklebust

Nack. This is an api change...

API change ? printk ? dprintk?

dprintk != printk. We have NEVER supported dprintk(KERN_WARNING...)

Please use one or the other, but don't try to mix APIs.

Thank you very much.
I will send a new patch for change the using of dprintk(KERN_WARNING...).

thanks,
Kinglong Mee

Quoted 57 lines
Quoted 48 lines
Quoted 9 lines · On May 28, 2014 10:55 PM, "Kinglong Mee" <[email protected]…

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

Quoted 30 lines
    Signed-off-by: Kinglong Mee <[email protected] <mailto:[email protected]> <mailto:[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
Signature · 5 lines
Trond Myklebust

Linux NFS client maintainer, PrimaryData

[email protected] <mailto:[email protected]>