From: Simon Horman <simon.horman@corigine.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com,
linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH v2] Bluetooth: 6LoWPAN: Add missing check for skb_clone
Date: Wed, 29 Mar 2023 19:52:27 +0200 [thread overview]
Message-ID: <ZCR62737I2hEPoCK@corigine.com> (raw)
In-Reply-To: <20230329020810.32959-1-jiasheng@iscas.ac.cn>
On Wed, Mar 29, 2023 at 10:08:10AM +0800, Jiasheng Jiang wrote:
> On Tue, Mar 21, 2023 at 00:09:11AM +0800, Simon Horman wrote:
> >On Mon, Mar 20, 2023 at 02:31:55PM +0800, Jiasheng Jiang wrote:
> >> Return the error when send_pkt fails in order to avoid the error being
> >> overwritten.
> >> Moreover, remove the redundant 'ret'.
> >>
> >> Fixes: 9c238ca8ec79 ("Bluetooth: 6lowpan: Check transmit errors for multicast packets")
> >> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> >
> > I see that the error handling is imperfect - only the most recent
> > error value is returned.
> >
> > But I think this patch introduces a behavioural change: if
> > an error occurs then no attempt is made to send the
> > multicast packet to devices that follow in the list of peers.
> >
> > If so, I'd want to be sure that behaviour is desirable.
>
> I think it's a matter of trade-offs.
> The original error handling can complete the remaining correct tasks.
> However, my patch can avoid resource waste, because if the an
> error occurs, the rest is likely to go wrong.
> For example, if a memory allocation fails because of the insufficient
> memory, the next memory allocation will likely fails too.
I see your point.
> Maybe it is better to use different error handlings depending on the
> type of errors:
> Immediately return "ENOMEM" errors and continue execute if the other errors occur.
Yes, that might be interesting if we can clearly
differentiate between the two types of errors.
Yet, it brings complexity.
Given your explanation, perhaps the best idea is the implementation
provided by this patch.
next prev parent reply other threads:[~2023-03-29 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 2:08 Re: [PATCH v2] Bluetooth: 6LoWPAN: Add missing check for skb_clone Jiasheng Jiang
2023-03-29 17:52 ` Simon Horman [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-03-20 3:08 Jiasheng Jiang
2023-03-20 10:25 ` Simon Horman
2023-03-20 2:54 Jiasheng Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZCR62737I2hEPoCK@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiasheng@iscas.ac.cn \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).