Improve rds_sendmsg printk
From: Dave Jones <hidden>
Date: 2012-03-19 22:40:14
- 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 <redacted>
--- 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; }