From: Marek Lindner <lindner_marek@yahoo.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast+ogm queue purging race condition
Date: Thu, 7 Mar 2013 14:27:27 +0800 [thread overview]
Message-ID: <201303071427.27817.lindner_marek@yahoo.de> (raw)
In-Reply-To: <201303031306.41769.lindner_marek@yahoo.de>
On Sunday, March 03, 2013 13:06:41 Marek Lindner wrote:
> On Wednesday, February 27, 2013 17:58:15 Linus Lüssing wrote:
> > +/**
> > + * batadv_canceled_packets_free - Frees canceled forward packets
> > + * @head: A list of to be freed forw_packets
> > + *
> > + * This function canceles the scheduling of any packet in the provided
> > list, + * waits for any possibly running packet forwarding thread to
> > finish and + * finally, safely frees this forward packet.
> > + *
> > + * This function might sleep.
> > + */
> > +static void batadv_canceled_packets_free(struct hlist_head *head)
> > +{
> > + struct batadv_forw_packet *forw_packet;
> > + struct hlist_node *tmp_node, *safe_tmp_node;
> > +
> > + hlist_for_each_entry_safe(forw_packet, tmp_node, safe_tmp_node,
> > head, + canceled_list) {
> > + cancel_delayed_work_sync(&forw_packet->delayed_work);
> > +
> > + hlist_del(&forw_packet->canceled_list);
> > + batadv_forw_packet_free(forw_packet);
> > + }
> > +}
>
> I don't quite see how your patch can work when only one interface is
> deactivated and not the mesh as a whole. batadv_purge_outstanding_packets()
> also is called from batadv_hardif_disable_interface() in which case the
> broadcast packets re-arm themselves by appending the work item to their
> respective queues. That is why we have the magic "pending" check in the
> cleanup functions.
One idea could be to check the incoming interface status in
batadv_send_outstanding_bcast_packet() right below the mesh status check. If
the interface is going down we could exit immdiately. This could be even a
better solution than the pending check we have today.
Cheers,
Marek
next prev parent reply other threads:[~2013-03-07 6:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 9:58 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast+ogm queue purging race condition Linus Lüssing
2013-02-27 9:58 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix another, potential broadcast+ogm " Linus Lüssing
2013-03-03 5:06 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast+ogm queue " Marek Lindner
2013-03-07 6:27 ` Marek Lindner [this message]
2013-03-18 5:09 ` [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Fix broadcast queue limit on a removed interface Linus Lüssing
2013-03-18 5:09 ` [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: Remove unnecessary INIT_HLIST_NODE() calls Linus Lüssing
2013-03-18 5:09 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: Fix a potential bcast/ogm queue purging race condition (1) Linus Lüssing
2016-03-10 17:00 ` Sven Eckelmann
2016-04-09 16:23 ` Sven Eckelmann
2016-07-21 22:27 ` Sven Eckelmann
2016-07-22 11:46 ` Linus Lüssing
2013-03-18 5:09 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Fix a potential bcast/ogm qeueue purging race condition (2) Linus Lüssing
2013-03-18 5:09 ` [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: Fix a potential bcast/ogm queue purging race condition (3) Linus Lüssing
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=201303071427.27817.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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).