* [PATCH] bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr()
@ 2018-01-01 16:07 SF Markus Elfring
2018-01-03 7:00 ` Mahesh Bandewar (महेश बंडेवार)
0 siblings, 1 reply; 8+ messages in thread
From: SF Markus Elfring @ 2018-01-01 16:07 UTC (permalink / raw)
To: netdev, Andy Gospodarek, Jay Vosburgh, Veaceslav Falico
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 Jan 2018 17:00:04 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/bonding/bond_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index c669554d70bb..a96e0c9cc4bf 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3910,7 +3910,6 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
GFP_KERNEL);
if (!new_arr) {
ret = -ENOMEM;
- pr_err("Failed to build slave-array.\n");
goto out;
}
if (BOND_MODE(bond) == BOND_MODE_8023AD) {
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr()
2018-01-01 16:07 [PATCH] bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr() SF Markus Elfring
@ 2018-01-03 7:00 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-03 8:45 ` SF Markus Elfring
0 siblings, 1 reply; 8+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-01-03 7:00 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-netdev, Andy Gospodarek, Jay Vosburgh, Veaceslav Falico,
LKML, kernel-janitors
On Mon, Jan 1, 2018 at 8:07 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 1 Jan 2018 17:00:04 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
What is the issue with this message?
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/net/bonding/bond_main.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index c669554d70bb..a96e0c9cc4bf 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -3910,7 +3910,6 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
> GFP_KERNEL);
> if (!new_arr) {
> ret = -ENOMEM;
> - pr_err("Failed to build slave-array.\n");
> goto out;
> }
> if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> --
> 2.15.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr()
2018-01-03 7:00 ` Mahesh Bandewar (महेश बंडेवार)
@ 2018-01-03 8:45 ` SF Markus Elfring
2018-01-03 19:28 ` Mahesh Bandewar (महेश बंडेवार)
0 siblings, 1 reply; 8+ messages in thread
From: SF Markus Elfring @ 2018-01-03 8:45 UTC (permalink / raw)
To: Mahesh Bandewar (महेश बंडेवार),
linux-netdev
Cc: Andy Gospodarek, Jay Vosburgh, Veaceslav Falico, LKML,
kernel-janitors
>> Omit an extra message for a memory allocation failure in this function.
>>
>> This issue was detected by using the Coccinelle software.
>>
> What is the issue with this message?
* Is it redundant?
* Would a Linux allocation failure report be already sufficient here?
Regards,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr()
2018-01-03 8:45 ` SF Markus Elfring
@ 2018-01-03 19:28 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-03 21:58 ` Eric Dumazet
2018-01-04 8:19 ` bonding: Completion of error handling around bond_update_slave_arr() SF Markus Elfring
0 siblings, 2 replies; 8+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-01-03 19:28 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-netdev, Andy Gospodarek, Jay Vosburgh, Veaceslav Falico,
LKML, kernel-janitors
On Wed, Jan 3, 2018 at 12:45 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>>> Omit an extra message for a memory allocation failure in this function.
>>>
>>> This issue was detected by using the Coccinelle software.
>>>
>> What is the issue with this message?
>
> * Is it redundant?
>
> * Would a Linux allocation failure report be already sufficient here?
>
If you see 8 out of 9 call sites in this file ignore the return value.
This message in the log could give a clue when debugging. Unless it's
spamming it's not harmful, or is it?
> Regards,
> Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr()
2018-01-03 19:28 ` Mahesh Bandewar (महेश बंडेवार)
@ 2018-01-03 21:58 ` Eric Dumazet
2018-01-04 8:19 ` bonding: Completion of error handling around bond_update_slave_arr() SF Markus Elfring
1 sibling, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2018-01-03 21:58 UTC (permalink / raw)
To: Mahesh Bandewar (महेश बंडेवार),
SF Markus Elfring
Cc: linux-netdev, Andy Gospodarek, Jay Vosburgh, Veaceslav Falico,
LKML, kernel-janitors
On Wed, 2018-01-03 at 11:28 -0800, Mahesh Bandewar (महेश बंडेवार)
wrote:
> On Wed, Jan 3, 2018 at 12:45 AM, SF Markus Elfring
> <elfring@users.sourceforge.net> wrote:
> > > > Omit an extra message for a memory allocation failure in this function.
> > > >
> > > > This issue was detected by using the Coccinelle software.
> > > >
> > >
> > > What is the issue with this message?
> >
> > * Is it redundant?
> >
> > * Would a Linux allocation failure report be already sufficient here?
> >
>
> If you see 8 out of 9 call sites in this file ignore the return value.
> This message in the log could give a clue when debugging. Unless it's
> spamming it's not harmful, or is it?
A failed kzalloc() would already give a complete stack trace.
Really the pr_err() adds no value here.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Completion of error handling around bond_update_slave_arr()
2018-01-03 19:28 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-03 21:58 ` Eric Dumazet
@ 2018-01-04 8:19 ` SF Markus Elfring
2018-01-04 18:52 ` Mahesh Bandewar (महेश बंडेवार)
1 sibling, 1 reply; 8+ messages in thread
From: SF Markus Elfring @ 2018-01-04 8:19 UTC (permalink / raw)
To: Mahesh Bandewar (महेश बंडेवार),
linux-netdev
Cc: Andy Gospodarek, Jay Vosburgh, Veaceslav Falico, LKML,
kernel-janitors
> If you see 8 out of 9 call sites in this file ignore the return value.
How do you think about to fix error detection and corresponding
exception handling then?
Regards,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Completion of error handling around bond_update_slave_arr()
2018-01-04 8:19 ` bonding: Completion of error handling around bond_update_slave_arr() SF Markus Elfring
@ 2018-01-04 18:52 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-04 21:41 ` SF Markus Elfring
0 siblings, 1 reply; 8+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-01-04 18:52 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-netdev, Andy Gospodarek, Jay Vosburgh, Veaceslav Falico,
LKML, kernel-janitors
On Thu, Jan 4, 2018 at 12:19 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>> If you see 8 out of 9 call sites in this file ignore the return value.
>
> How do you think about to fix error detection and corresponding
> exception handling then?
>
If I understand your question correctly - not having memory is not a
correctable error and hence there are consequences. In this case, the
slave_arr is not going to be rebuilt and this might mean loosing
packets (if the interface was dropped) or not using the interface to
send packets if that was added (very unlikely case). From host's
perspective, however, this might be the last thing you want to worry
about when there is no memory left.
> Regards,
> Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bonding: Completion of error handling around bond_update_slave_arr()
2018-01-04 18:52 ` Mahesh Bandewar (महेश बंडेवार)
@ 2018-01-04 21:41 ` SF Markus Elfring
0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2018-01-04 21:41 UTC (permalink / raw)
To: Mahesh Bandewar (महेश बंडेवार),
linux-netdev
Cc: Andy Gospodarek, Jay Vosburgh, Veaceslav Falico, LKML,
kernel-janitors
>>> If you see 8 out of 9 call sites in this file ignore the return value.
>>
>> How do you think about to fix error detection and corresponding
>> exception handling then?
>>
> If I understand your question correctly - not having memory is not a
> correctable error
I am unsure if it would be feasible to retry memory allocations for
this software module under other circumstances.
> and hence there are consequences.
Could one consequence be to let the error code “-ENOMEM” move through
the function call hierarchy?
Regards,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-01-04 21:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-01 16:07 [PATCH] bonding: Delete an error message for a failed memory allocation in bond_update_slave_arr() SF Markus Elfring
2018-01-03 7:00 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-03 8:45 ` SF Markus Elfring
2018-01-03 19:28 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-03 21:58 ` Eric Dumazet
2018-01-04 8:19 ` bonding: Completion of error handling around bond_update_slave_arr() SF Markus Elfring
2018-01-04 18:52 ` Mahesh Bandewar (महेश बंडेवार)
2018-01-04 21:41 ` SF Markus Elfring
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).