* [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist
@ 2018-02-12 10:29 Xin Long
2018-02-12 12:29 ` Marcelo Ricardo Leitner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xin Long @ 2018-02-12 10:29 UTC (permalink / raw)
To: network dev, linux-sctp; +Cc: davem, Marcelo Ricardo Leitner, Neil Horman
The pr_err in sctp_hash_transport was supposed to report a sctp bug
for using rhashtable/rhlist.
The err '-EEXIST' introduced in Commit cd2b70875058 ("sctp: check
duplicate node before inserting a new transport") doesn't belong
to that case.
So just return -EEXIST back without pr_err any kmsg.
Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport")
Reported-by: Wei Chen <weichen@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sctp/input.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 141c9c4..0247cc4 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t)
rhl_for_each_entry_rcu(transport, tmp, list, node)
if (transport->asoc->ep == t->asoc->ep) {
rcu_read_unlock();
- err = -EEXIST;
- goto out;
+ return -EEXIST;
}
rcu_read_unlock();
err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
&t->node, sctp_hash_params);
-
-out:
if (err)
pr_err_once("insert transport fail, errno %d\n", err);
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist
2018-02-12 10:29 [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist Xin Long
@ 2018-02-12 12:29 ` Marcelo Ricardo Leitner
2018-02-12 13:59 ` Neil Horman
2018-02-12 16:47 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2018-02-12 12:29 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
On Mon, Feb 12, 2018 at 06:29:06PM +0800, Xin Long wrote:
> The pr_err in sctp_hash_transport was supposed to report a sctp bug
> for using rhashtable/rhlist.
>
> The err '-EEXIST' introduced in Commit cd2b70875058 ("sctp: check
> duplicate node before inserting a new transport") doesn't belong
> to that case.
>
> So just return -EEXIST back without pr_err any kmsg.
>
> Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport")
> Reported-by: Wei Chen <weichen@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/input.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 141c9c4..0247cc4 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t)
> rhl_for_each_entry_rcu(transport, tmp, list, node)
> if (transport->asoc->ep == t->asoc->ep) {
> rcu_read_unlock();
> - err = -EEXIST;
> - goto out;
> + return -EEXIST;
> }
> rcu_read_unlock();
>
> err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
> &t->node, sctp_hash_params);
> -
> -out:
> if (err)
> pr_err_once("insert transport fail, errno %d\n", err);
>
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist
2018-02-12 10:29 [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist Xin Long
2018-02-12 12:29 ` Marcelo Ricardo Leitner
@ 2018-02-12 13:59 ` Neil Horman
2018-02-12 16:47 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Neil Horman @ 2018-02-12 13:59 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, linux-sctp, davem, Marcelo Ricardo Leitner
On Mon, Feb 12, 2018 at 06:29:06PM +0800, Xin Long wrote:
> The pr_err in sctp_hash_transport was supposed to report a sctp bug
> for using rhashtable/rhlist.
>
> The err '-EEXIST' introduced in Commit cd2b70875058 ("sctp: check
> duplicate node before inserting a new transport") doesn't belong
> to that case.
>
> So just return -EEXIST back without pr_err any kmsg.
>
> Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport")
> Reported-by: Wei Chen <weichen@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/sctp/input.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 141c9c4..0247cc4 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t)
> rhl_for_each_entry_rcu(transport, tmp, list, node)
> if (transport->asoc->ep == t->asoc->ep) {
> rcu_read_unlock();
> - err = -EEXIST;
> - goto out;
> + return -EEXIST;
> }
> rcu_read_unlock();
>
> err = rhltable_insert_key(&sctp_transport_hashtable, &arg,
> &t->node, sctp_hash_params);
> -
> -out:
> if (err)
> pr_err_once("insert transport fail, errno %d\n", err);
>
> --
> 2.1.0
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist
2018-02-12 10:29 [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist Xin Long
2018-02-12 12:29 ` Marcelo Ricardo Leitner
2018-02-12 13:59 ` Neil Horman
@ 2018-02-12 16:47 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-02-12 16:47 UTC (permalink / raw)
To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman
From: Xin Long <lucien.xin@gmail.com>
Date: Mon, 12 Feb 2018 18:29:06 +0800
> The pr_err in sctp_hash_transport was supposed to report a sctp bug
> for using rhashtable/rhlist.
>
> The err '-EEXIST' introduced in Commit cd2b70875058 ("sctp: check
> duplicate node before inserting a new transport") doesn't belong
> to that case.
>
> So just return -EEXIST back without pr_err any kmsg.
>
> Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport")
> Reported-by: Wei Chen <weichen@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-12 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 10:29 [PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist Xin Long
2018-02-12 12:29 ` Marcelo Ricardo Leitner
2018-02-12 13:59 ` Neil Horman
2018-02-12 16:47 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).