mbox

pull request net: batman-adv 20140510

Message ID 1399736110-22333-1-git-send-email-antonio@meshcoding.com (mailing list archive)
State Not Applicable, archived
Headers

Pull-request

git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem

Message

Antonio Quartulli May 10, 2014, 3:35 p.m. UTC
  Hello David,

here you have 4 small but important patches from Simon Wunderlich intended
for net/linux-3.15 and *stable/linux-3.14* (please enqueue them).

I know it's rather late in the rc cycle but these 4 changes are addressing
some severe reference counting imbalances in different parts of code.

All these reference counting problems are rather important because they prevent
the netdev object used by batman-adv from being released and then the
system from properly shutdown/reboot/reconfigure by holding the networking stack
with the following (sad) message:

unregister_netdevice: waiting for mesh0 to become free. Usage count = 1


Please pull or let me know of any problem!

Thanks a lot,
	Antonio


The following changes since commit 1448eb566970c6d3cade522419848fdaee24c684:

  Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-05-09 16:46:53 -0400)

are available in the git repository at:


  git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem

for you to fetch changes up to 29bcc8064fc0b82bc708c09577d550923b954e5a:

  batman-adv: fix removing neigh_ifinfo (2014-05-10 10:59:05 +0200)

----------------------------------------------------------------
Included changes:
- properly release neigh_ifinfo in batadv_iv_ogm_process_per_outif()
- properly release orig_ifinfo->router when freeing orig_ifinfo
- properly release neigh_node objects during periodic check
- properly release neigh_info objects when the related hard_iface
  is free'd

These changes are all very important because they fix some
reference counting imbalances that lead to the
impossibility of releasing the netdev object used by
batman-adv on shutdown.
The consequence is that such object cannot be destroyed by
the networking stack (the refcounter does not reach zero)
thus bringing the system in hanging state during a normal
reboot operation or a network reconfiguration.

----------------------------------------------------------------
Simon Wunderlich (4):
      batman-adv: fix neigh_ifinfo imbalance
      batman-adv: fix neigh reference imbalance
      batman-adv: always run purge_orig_neighbors
      batman-adv: fix removing neigh_ifinfo

 net/batman-adv/bat_iv_ogm.c |  2 ++
 net/batman-adv/originator.c | 59 ++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 57 insertions(+), 4 deletions(-)
  

Comments

Antonio Quartulli May 10, 2014, 3:40 p.m. UTC | #1
On 10/05/14 17:35, Antonio Quartulli wrote:
> The following changes since commit 1448eb566970c6d3cade522419848fdaee24c684:
> 
>   Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-05-09 16:46:53 -0400)
> 
> are available in the git repository at:
> 
> 
>   git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
> 
> for you to fetch changes up to 29bcc8064fc0b82bc708c09577d550923b954e5a:

The tag points now to 05191f523653461ca6a4e4fb38012e0d8f3c5641 because I
fixed a too long line.


Cheers,
  
Sergei Shtylyov May 10, 2014, 8:39 p.m. UTC | #2
Hello.

On 05/10/2014 07:35 PM, Antonio Quartulli wrote:

> From: Simon Wunderlich <simon@open-mesh.com>

> When an interface is removed separately, all neighbors need to be
> checked if they have a neigh_ifinfo structure for that particular
> interface. If that is the case, remove that ifinfo so any references to
> a hard interface can be freed.

> This is a regression introduced by
> 89652331c00f43574515059ecbf262d26d885717
> ("batman-adv: split tq information in neigh_node struct")

> Reported-by: Antonio Quartulli <antonio@open-mesh.com>
> Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
>   net/batman-adv/originator.c | 46 +++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 46 insertions(+)

> diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
> index 8104c3c..427c07d 100644
> --- a/net/batman-adv/originator.c
> +++ b/net/batman-adv/originator.c
> @@ -707,6 +707,47 @@ free_orig_node:
>   }
>
>   /**
> + * batadv_purge_neigh_ifinfo - purge obsolete ifinfo entries from neighbor
> + * @bat_priv: the bat priv with all the soft interface information
> + * @neigh_node: orig node which is to be checked

    The corresponding parameter is called just 'neigh'.

> + */
> +static void
> +batadv_purge_neigh_ifinfo(struct batadv_priv *bat_priv,
> +			  struct batadv_neigh_node *neigh)
[...]

WBR, Sergei
  
Antonio Quartulli May 11, 2014, 7:02 a.m. UTC | #3
On 10/05/14 22:39, Sergei Shtylyov wrote:
>>   /**
>> + * batadv_purge_neigh_ifinfo - purge obsolete ifinfo entries from
>> neighbor
>> + * @bat_priv: the bat priv with all the soft interface information
>> + * @neigh_node: orig node which is to be checked
> 
>    The corresponding parameter is called just 'neigh'.
> 
>> + */
>> +static void
>> +batadv_purge_neigh_ifinfo(struct batadv_priv *bat_priv,
>> +              struct batadv_neigh_node *neigh)
> [...]
> 

Good catch! Thanks Sergei

I will fix that and update the tag.


Cheers,

> WBR, Sergei
>
  
Antonio Quartulli May 11, 2014, 7:16 a.m. UTC | #4
On 10/05/14 17:40, Antonio Quartulli wrote:
> On 10/05/14 17:35, Antonio Quartulli wrote:
>> The following changes since commit 1448eb566970c6d3cade522419848fdaee24c684:
>>
>>   Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-05-09 16:46:53 -0400)
>>
>> are available in the git repository at:
>>
>>
>>   git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
>>
>> for you to fetch changes up to 29bcc8064fc0b82bc708c09577d550923b954e5a:
> 
> The tag points now to 05191f523653461ca6a4e4fb38012e0d8f3c5641 because I
> fixed a too long line.
> 

David,

the batman-adv-fix-for-davem tag now points to
709de13f0c532fe9c468c094aff069a725ed57fe which contains the fix for the
long line I said before, the fix for the kerneldoc as suggested by
Sergei and a correction of a small typ0.


I can re-send the whole pull request if you want, but I wanted to avoid
to create more noise, unless it is needed.

Thanks a lot.


Cheers,
  
David Miller May 13, 2014, 4:54 p.m. UTC | #5
From: Antonio Quartulli <antonio@meshcoding.com>
Date: Sat, 10 May 2014 17:35:06 +0200

> here you have 4 small but important patches from Simon Wunderlich intended
> for net/linux-3.15 and *stable/linux-3.14* (please enqueue them).
> 
> I know it's rather late in the rc cycle but these 4 changes are addressing
> some severe reference counting imbalances in different parts of code.

Pulled and queued up for -stable, thanks.