From: Pavel Roskin <proski@gnu.org>
To: Arend van Spriel <arend@broadcom.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] mac80211: use BUG_ON and return -EINVAL if rate_lowest_index() fails
Date: Fri, 17 Jun 2011 16:33:38 -0400 [thread overview]
Message-ID: <4DFBBA22.4050406@gnu.org> (raw)
In-Reply-To: <4DFAF645.5030303@broadcom.com>
On 06/17/2011 02:37 AM, Arend van Spriel wrote:
> On 06/17/2011 12:08 AM, Pavel Roskin wrote:
>> In my case, I was able to restart the system by sysrq when using BUG_ON,
>> but the system would hang hard with WARN_ON. I think continuing after
>> returning an invalid index is wrong. It will lead to memory corruption
>> that could in turn lead to corruption of the filesystem.
>
> I think it is generally a bad idea to use BUG_ON as a solution. As
> Stanislaw indicated there are platforms which can continue without a
> hang so you are regressing those. Regarding your patch I think the
> -EINVAL is good to have, but leave the WARN_ON.
Well, then it would be pointless. The whole idea was to prevent memory
corruption and to stop early. Returning -EINVAL for real (as opposed to
having it in the dead code) could lead to worse memory corruption than
returning 0.
The real fix would be to make rate control algorithms robust to the case
when no rates are allowed. My patch was meant as a first little step
towards it by making it easier to capture the backtrace and restart the
system. But it's not worth the trouble for me to argue about it.
--
Regards,
Pavel Roskin
next prev parent reply other threads:[~2011-06-17 20:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 22:02 [PATCH] mac80211: use BUG_ON and return -EINVAL if rate_lowest_index() fails Pavel Roskin
2011-06-16 9:08 ` Arend van Spriel
2011-06-16 22:06 ` Pavel Roskin
2011-06-16 10:22 ` Stanislaw Gruszka
2011-06-16 22:08 ` Pavel Roskin
2011-06-17 6:37 ` Arend van Spriel
2011-06-17 20:33 ` Pavel Roskin [this message]
2011-06-19 8:05 ` Johannes Berg
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=4DFBBA22.4050406@gnu.org \
--to=proski@gnu.org \
--cc=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sgruszka@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).