Skip to contentSkip to conversation

netfilter: don't output error message redundantly

PATCH Superseded Duan Jiong 3 participants 6 messages Jul 23, 2014 – Mar 6, 2015

Subsystems (2)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 netfilter: don't output error message redundantly

The function led_trigger_register() will only return -EEXIST when error arises.

---
 net/netfilter/xt_LED.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/xt_LED.c +1 -3
index 993de2b..b47a58c 100644
@@ -133,9 +133,7 @@ static int led_tg_check(const struct xt_tgchk_param *par)
 
 	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
 	if (err) {
-		pr_warning("led_trigger_register() failed\n");
-		if (err == -EEXIST)
-			pr_warning("Trigger name is already in use.\n");
+		pr_warning("Trigger name is already in use.\n");
 		goto exit_alloc;
 	}
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 14 lines · Duan Jiong

The function led_trigger_register() will only return -EEXIST when error arises.

---
 net/netfilter/xt_LED.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/xt_LED.c +0 -0
index 993de2b..b47a58c 100644

net/netfilter/xt_LED.c static int led_tg_check(const struct xt_tgchk_param *par) · line 136

Quoted 7 lines
net/netfilter/xt_LED.c +1 -3
@@ -133,9 +133,7 @@ static int led_tg_check(const struct xt_tgchk_param *par)
 
 	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
 	if (err) {
-		pr_warning("led_trigger_register() failed\n");
-		if (err == -EEXIST)
-			pr_warning("Trigger name is already in use.\n");
+		pr_warning("Trigger name is already in use.\n");

This should be pr_err() since the rule fails to be loaded if led_trigger_register() fails.

author
#2 lore raw

PATCH v2 1/1 netfilter: don't output error message redundantly

The function led_trigger_register() will only return -EEXIST when error arises.

---

v2: use pr_err rather than pr_warning

 net/netfilter/xt_LED.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/xt_LED.c +1 -3
index 993de2b..f14bcf2 100644
@@ -133,9 +133,7 @@ static int led_tg_check(const struct xt_tgchk_param *par)
 
 	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
 	if (err) {
-		pr_warning("led_trigger_register() failed\n");
-		if (err == -EEXIST)
-			pr_warning("Trigger name is already in use.\n");
+		pr_err("Trigger name is already in use.\n");
 		goto exit_alloc;
 	}
 
Signature · 1 line
1.8.3.1
maintainer Applied
#3 lore raw
Quoted 3 lines · Duan Jiong

The function led_trigger_register() will only return -EEXIST when error arises.

Applied, thanks.

#4 lore raw
In reply to Pablo Neira Ayuso

Am 24. Juli 2014 13:49:46 MESZ, schrieb Pablo Neira Ayuso <[email protected]>:

Quoted 17 lines · Duan Jiong

net/netfilter/xt_LED.c static int led_tg_check(const struct

Quoted 14 lines

The function led_trigger_register() will only return -EEXIST when error arises.

---
 net/netfilter/xt_LED.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/xt_LED.c +0 -0
index 993de2b..b47a58c 100644
@@ -133,9 +133,7 @@ static int led_tg_check(const struct

xt_tgchk_param *par)

Quoted 1 line
Quoted 9 lines

net/netfilter/xt_LED.c static int led_tg_check(const struct xt_tgchk_param *par) · line 136

Quoted 6 lines
net/netfilter/xt_LED.c +1 -3
 	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
 	if (err) {
-		pr_warning("led_trigger_register() failed\n");
-		if (err == -EEXIST)
-			pr_warning("Trigger name is already in use.\n");
+		pr_warning("Trigger name is already in use.\n");

This should be pr_err() since the rule fails to be loaded if led_trigger_register() fails.

I disagree with this patch, any error and EEXIST are two different things.

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Am 6. März 2015 22:27:09 MEZ, schrieb Patrick McHardy <[email protected]>:

Quoted 29 lines

Am 24. Juli 2014 13:49:46 MESZ, schrieb Pablo Neira Ayuso <[email protected]>:

Quoted 17 lines · Duan Jiong

net/netfilter/xt_LED.c static int led_tg_check(const struct

Quoted 14 lines

The function led_trigger_register() will only return -EEXIST when error arises.

---
 net/netfilter/xt_LED.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/xt_LED.c +0 -0
index 993de2b..b47a58c 100644
@@ -133,9 +133,7 @@ static int led_tg_check(const struct

xt_tgchk_param *par)

Quoted 1 line
Quoted 9 lines

net/netfilter/xt_LED.c static int led_tg_check(const struct xt_tgchk_param *par) · line 136

Quoted 6 lines
net/netfilter/xt_LED.c +1 -3
 	err = led_trigger_register(&ledinternal->netfilter_led_trigger);
 	if (err) {
-		pr_warning("led_trigger_register() failed\n");
-		if (err == -EEXIST)
-			pr_warning("Trigger name is already in use.\n");
+		pr_warning("Trigger name is already in use.\n");

This should be pr_err() since the rule fails to be loaded if led_trigger_register() fails.

Quoted 2 lines

I disagree with this patch, any error and EEXIST are two different things.

Sorry didn't notice mails on my tablet were 9 months out oft sync :)

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html