diff mbox

Improve rds_sendmsg printk

Message ID 20120319224008.GA23036@redhat.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Dave Jones March 19, 2012, 10:40 p.m. UTC
- 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 <davej@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller March 19, 2012, 10:43 p.m. UTC | #1
From: Dave Jones <davej@redhat.com>
Date: Mon, 19 Mar 2012 18:40:09 -0400

> - 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 <davej@redhat.com>

I think it should be removed entirely, no socket layer outputs
a message for this error and neither should rds.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joe Perches March 19, 2012, 11:08 p.m. UTC | #2
On Mon, 2012-03-19 at 18:40 -0400, Dave Jones wrote:
> - 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 <davej@redhat.com>
> 
> --- linux/net/rds/send.c	2011-11-07 12:00:32.000000000 -0500
> +++ linux/net/rds/send.c	2012-03-19 18:36:21.804991923 -0400
> @@ -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/


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Venkat Venkatsubra March 20, 2012, 2:50 p.m. UTC | #3
On 3/19/2012 5:43 PM, David Miller wrote:
> From: Dave Jones<davej@redhat.com>
> Date: Mon, 19 Mar 2012 18:40:09 -0400
>
>> - 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<davej@redhat.com>
> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- linux/net/rds/send.c	2011-11-07 12:00:32.000000000 -0500
+++ linux/net/rds/send.c	2012-03-19 18:36:21.804991923 -0400
@@ -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;
 	}