Skip to contentSkip to conversation

Improve rds_sendmsg printk

PATCH Dave Jones 4 participants 6 messages Mar 19, 2012 – Mar 20, 2012

Subsystems (3)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

- 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;
 	}
maintainer
#1 lore raw

From: 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.

I think it should be removed entirely, no socket layer outputs a message for this error and neither should rds.

author
#2 lore raw

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;
 	}
#5 lore raw
In reply to Dave Jones
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.

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/

#4 lore raw
In reply to David Miller
Quoted 10 lines · David Miller

From: 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.

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