From: Johannes Berg <johannes@sipsolutions.net>
To: Thomas Pedersen <thomas@cozybit.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
open80211s <devel@lists.open80211s.org>,
Bob Copeland <me@bobcopeland.com>
Subject: Re: [PATCH v2 2/2] mac80211: update mesh beacon on workqueue
Date: Tue, 11 Jun 2013 13:30:16 +0200 [thread overview]
Message-ID: <1370950216.8356.10.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1370895442-21784-2-git-send-email-thomas@cozybit.com> (sfid-20130610_221954_141807_F12A5B9B)
On Mon, 2013-06-10 at 13:17 -0700, Thomas Pedersen wrote:
> + struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
> + u32 bit;
> +
> + /* if we race with running work, worst case this work becomes a noop */
> + for_each_set_bit(bit, (unsigned long *)&changed,
> + sizeof(changed) * BITS_PER_BYTE)
This isn't valid, it happens to work on little endian platforms but will
fail on big endian 64-bit ones, because you have this in memory (0 is
the lowest order nibble):
76 54 32 10 -- -- -- --
and now you point an unsigned long pointer to it, so you interpret the
"--" as the lowest bits.
More generally, I'd argue that mesh is being a bit odd here, flushing
stations turing mesh stop can and will actually cause a BSS info update
after the mesh interface has already been stopped (beaconing has been
disabled in the driver.) This seems rather odd. Maybe it would be better
to move the beacon update out of mesh_sta_cleanup() and into
ieee80211_mesh_housekeeping() in some way? Although it'd also have to be
done in the station handling in cfg.c but that shouldn't be a problem?
Note also that the way you did this is rather odd, ieee80211_stop_mesh()
could cause to schedule out to the workqueue for the update, but then
the update won't happen. It's a bit racy though, because you could stop
and restart the mesh and then the workqueue runs or something? Overall
this approach seems a bit brittle?
johannes
next prev parent reply other threads:[~2013-06-11 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 20:17 [PATCH v2 1/2] mac80211: fix mesh deadlock Thomas Pedersen
2013-06-10 20:17 ` [PATCH v2 2/2] mac80211: update mesh beacon on workqueue Thomas Pedersen
2013-06-11 11:30 ` Johannes Berg [this message]
2013-06-11 20:32 ` Thomas Pedersen
2013-06-11 11:15 ` [PATCH v2 1/2] mac80211: fix mesh deadlock 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=1370950216.8356.10.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=devel@lists.open80211s.org \
--cc=linux-wireless@vger.kernel.org \
--cc=me@bobcopeland.com \
--cc=thomas@cozybit.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).