mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
sctp: Add process name and pid to deprecation warnings
Recently I updated the sctp socket option deprecation warnings to be both a bit more clear and ratelimited to prevent user processes from spamming the log file. Ben Hutchings suggested that I add the process name and pid to these warnings so that users can tell who is responsible for using the deprecated apis. This patch accomplishes that. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yasevich <vyasevich@gmail.com> CC: Ben Hutchings <bhutchings@solarflare.com> CC: "David S. Miller" <davem@davemloft.net> CC: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2d4dda781f
commit
f916ec9608
@ -2579,8 +2579,10 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk,
|
|||||||
return 0;
|
return 0;
|
||||||
} else if (optlen == sizeof(struct sctp_assoc_value)) {
|
} else if (optlen == sizeof(struct sctp_assoc_value)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of struct sctp_assoc_value in delayed_ack socket option.\n"
|
"Use of struct sctp_assoc_value in delayed_ack socket option.\n"
|
||||||
"Use struct sctp_sack_info instead\n");
|
"Use struct sctp_sack_info instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
if (copy_from_user(¶ms, optval, optlen))
|
if (copy_from_user(¶ms, optval, optlen))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
@ -2996,8 +2998,10 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned
|
|||||||
|
|
||||||
if (optlen == sizeof(int)) {
|
if (optlen == sizeof(int)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of int in maxseg socket option.\n"
|
"Use of int in maxseg socket option.\n"
|
||||||
"Use struct sctp_assoc_value instead\n");
|
"Use struct sctp_assoc_value instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
if (copy_from_user(&val, optval, optlen))
|
if (copy_from_user(&val, optval, optlen))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
params.assoc_id = 0;
|
params.assoc_id = 0;
|
||||||
@ -3255,8 +3259,10 @@ static int sctp_setsockopt_maxburst(struct sock *sk,
|
|||||||
|
|
||||||
if (optlen == sizeof(int)) {
|
if (optlen == sizeof(int)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of int in max_burst socket option deprecated.\n"
|
"Use of int in max_burst socket option deprecated.\n"
|
||||||
"Use struct sctp_assoc_value instead\n");
|
"Use struct sctp_assoc_value instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
if (copy_from_user(&val, optval, optlen))
|
if (copy_from_user(&val, optval, optlen))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
} else if (optlen == sizeof(struct sctp_assoc_value)) {
|
} else if (optlen == sizeof(struct sctp_assoc_value)) {
|
||||||
@ -4577,8 +4583,10 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
} else if (len == sizeof(struct sctp_assoc_value)) {
|
} else if (len == sizeof(struct sctp_assoc_value)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of struct sctp_assoc_value in delayed_ack socket option.\n"
|
"Use of struct sctp_assoc_value in delayed_ack socket option.\n"
|
||||||
"Use struct sctp_sack_info instead\n");
|
"Use struct sctp_sack_info instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
if (copy_from_user(¶ms, optval, len))
|
if (copy_from_user(¶ms, optval, len))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
} else
|
} else
|
||||||
@ -5223,8 +5231,10 @@ static int sctp_getsockopt_maxseg(struct sock *sk, int len,
|
|||||||
|
|
||||||
if (len == sizeof(int)) {
|
if (len == sizeof(int)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of int in maxseg socket option.\n"
|
"Use of int in maxseg socket option.\n"
|
||||||
"Use struct sctp_assoc_value instead\n");
|
"Use struct sctp_assoc_value instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
params.assoc_id = 0;
|
params.assoc_id = 0;
|
||||||
} else if (len >= sizeof(struct sctp_assoc_value)) {
|
} else if (len >= sizeof(struct sctp_assoc_value)) {
|
||||||
len = sizeof(struct sctp_assoc_value);
|
len = sizeof(struct sctp_assoc_value);
|
||||||
@ -5316,8 +5326,10 @@ static int sctp_getsockopt_maxburst(struct sock *sk, int len,
|
|||||||
|
|
||||||
if (len == sizeof(int)) {
|
if (len == sizeof(int)) {
|
||||||
pr_warn_ratelimited(DEPRECATED
|
pr_warn_ratelimited(DEPRECATED
|
||||||
|
"%s (pid %d) "
|
||||||
"Use of int in max_burst socket option.\n"
|
"Use of int in max_burst socket option.\n"
|
||||||
"Use struct sctp_assoc_value instead\n");
|
"Use struct sctp_assoc_value instead\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
||||||
params.assoc_id = 0;
|
params.assoc_id = 0;
|
||||||
} else if (len >= sizeof(struct sctp_assoc_value)) {
|
} else if (len >= sizeof(struct sctp_assoc_value)) {
|
||||||
len = sizeof(struct sctp_assoc_value);
|
len = sizeof(struct sctp_assoc_value);
|
||||||
|
Loading…
Reference in New Issue
Block a user