Improve rds_sendmsg printk
Subsystems (3)
- Given this can be called by any user, prevent them from flooding the logs by using printk_ratelimited
- Also add a rds: prefix, so it's clear where the message is coming from.
net/rds/send.c +1 -1
@@ -935,7 +935,7 @@ int rds_sendmsg(struct kiocb *iocb, stru/* Mirror Linux UDP mirror of BSD error message compatibility */ /* XXX: Perhaps MSG_MORE someday */ if (msg->msg_flags & ~(MSG_DONTWAIT |MSG_CMSG_COMPAT )) { -printk (KERN_INFO "msg_flags 0x%08X\n" , msg->msg_flags); +printk_ratelimited (KERN_INFO "rds: msg_flags 0x%08X\n" , msg->msg_flags); ret = -EOPNOTSUPP ; goto out; }
David Miller
maintainerFrom: Dave Jones <[email protected]>
Date: Mon, 19 Mar 2012 18:40:09 -0400
Quoted 5 lines
- Given this can be called by any user, prevent them from flooding the logs by using
printk_ratelimited
- Also add a rds: prefix, so it's clear where the message is coming from.Signed-off-by Dave Jones <[email protected]>
I think it should be removed entirely, no socket layer outputs a message for this error and neither should rds.
Remove printk from rds_sendmsg
no socket layer outputs a message for this error and neither should rds.
net/rds/send.c +0 -1
@@ -935,7 +935,6 @@ int rds_sendmsg(struct kiocb *iocb, stru/* Mirror Linux UDP mirror of BSD error message compatibility */ /* XXX: Perhaps MSG_MORE someday */ if (msg->msg_flags & ~(MSG_DONTWAIT |MSG_CMSG_COMPAT )) { -printk (KERN_INFO "msg_flags 0x%08X\n" , msg->msg_flags); ret = -EOPNOTSUPP ; goto out; }
Quoted 9 lines · Dave Jones
- Given this can be called by any user, prevent them from flooding the logs by using
printk_ratelimited
- Also add a rds: prefix, so it's clear where the message is coming from.Signed-off-by Dave Jones <[email protected]>
net/rds/send.c int rds_sendmsg(struct kiocb *iocb, stru · line 938
Quoted 5 lines
net/rds/send.c +1
-1@@ -935,7 +935,7 @@ int rds_sendmsg(struct kiocb *iocb, stru/* Mirror Linux UDP mirror of BSD error message compatibility */ /* XXX: Perhaps MSG_MORE someday */ if (msg->msg_flags & ~(MSG_DONTWAIT |MSG_CMSG_COMPAT )) { -printk (KERN_INFO "msg_flags 0x%08X\n" , msg->msg_flags); +printk_ratelimited (KERN_INFO "rds: msg_flags 0x%08X\n" , msg->msg_flags);
It might be better to use net_ratelimit
for all the rds printk_ratelimited calls.
That's a bit more standardized across net/
Quoted 10 lines · David Miller
From: Dave Jones<[email protected]>
Date: Mon, 19 Mar 2012 18:40:09 -0400Quoted 5 lines
- Given this can be called by any user, prevent them from flooding the logs by using
printk_ratelimited
- Also add a rds: prefix, so it's clear where the message is coming from.Signed-off-by Dave Jones<[email protected]>I think it should be removed entirely, no socket layer outputs a message for this error and neither should rds.
Agree, the message could be removed entirely.
Venkat
David Miller
maintainerRe: Remove printk from rds_sendmsg
In reply to Dave JonesFrom: Dave Jones <[email protected]>
Date: Mon, 19 Mar 2012 19:01:07 -0400
Quoted 3 lines
no socket layer outputs a message for this error and neither should rds.
Signed-off-by Dave Jones <[email protected]>
Applied and queued up for -stable, thanks.