netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Pravin B Shelar <pshelar@nicira.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: WARNING: at net/batman-adv/hard-interface.c:92 batadv_is_on_batman_iface()
Date: Sat, 30 Mar 2013 12:52:45 +0100	[thread overview]
Message-ID: <20130330115245.GA4024@ritirata.org> (raw)
In-Reply-To: <20130330093635.GA31605@localhost>

[-- Attachment #1: Type: text/plain, Size: 3709 bytes --]

Hello all,

On Sat, Mar 30, 2013 at 05:36:35PM +0800, Fengguang Wu wrote:
> Greetings,
> 
> I got the below WARNING in net-next/master (head commit f498354793d5)
> and the first bad commit is
> 
> commit c54419321455631079c7d6e60bc732dd0c5914c5
> Author: Pravin B Shelar <pshelar@nicira.com>
> Date:   Mon Mar 25 14:49:35 2013 +0000
> 
>     GRE: Refactor GRE tunneling code.
>     
>     Following patch refactors GRE code into ip tunneling code and GRE
>     specific code. Common tunneling code is moved to ip_tunnel module.
>     ip_tunnel module is written as generic library which can be used
>     by different tunneling implementations.
>     
>     ip_tunnel module contains following components:
>      - packet xmit and rcv generic code. xmit flow looks like
>        (gre_xmit/ipip_xmit)->ip_tunnel_xmit->ip_local_out.
>      - hash table of all devices.
>      - lookup for tunnel devices.
>      - control plane operations like device create, destroy, ioctl, netlink
>        operations code.
>      - registration for tunneling modules, like gre, ipip etc.
>      - define single pcpu_tstats dev->tstats.
>      - struct tnl_ptk_info added to pass parsed tunnel packet parameters.
>     
>     ipip.h header is renamed to ip_tunnel.h
>     
>     Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> [   27.507156] libceph: loaded (mon/osd proto 15/24)
> [   27.515409] ------------[ cut here ]------------
> [   27.518917] WARNING: at /c/kernel-tests/src/stable/net/batman-adv/hard-interface.c:92 batadv_is_on_batman_iface+0x5c/0x7a()
> [   27.521935] Hardware name: Bochs
> [   27.525356] Cannot find parent device
> [   27.528296] Modules linked in:
> [   27.529923] Pid: 1, comm: swapper/0 Not tainted 3.9.0-rc4-00896-g03ba910 #794
> [   27.531747] Call Trace:
> [   27.534683]  [<ffffffff81098ab4>] warn_slowpath_common+0x83/0x9e
> [   27.536338]  [<ffffffff81098b72>] warn_slowpath_fmt+0x46/0x48
> [   27.537872]  [<ffffffff828e6402>] ? rcu_read_unlock+0x1c/0x2d
> [   27.539441]  [<ffffffff810ca498>] ? local_clock+0x19/0x52
> [   27.541023]  [<ffffffff82c0e796>] batadv_is_on_batman_iface+0x5c/0x7a
> [   27.542803]  [<ffffffff82c0efe2>] batadv_hard_if_event+0x8f/0x285
> [   27.544551]  [<ffffffff828e4ff0>] register_netdevice_notifier+0x71/0x17e
> [   27.550617]  [<ffffffff8420a030>] ? batadv_iv_init+0x3f/0x3f
> [   27.552248]  [<ffffffff8420a114>] batadv_init+0xe4/0x104
> [   27.553770]  [<ffffffff810020be>] do_one_initcall+0x7f/0x13d
> [   27.555386]  [<ffffffff84177eb0>] kernel_init_freeable+0x141/0x1d0
> [   27.557177]  [<ffffffff84177734>] ? do_early_param+0x8c/0x8c
> [   27.558813]  [<ffffffff82c1f146>] ? rest_init+0xda/0xda
> [   27.560348]  [<ffffffff82c1f154>] kernel_init+0xe/0xdb
> [   27.561813]  [<ffffffff82c694ac>] ret_from_fork+0x7c/0xb0
> [   27.563356]  [<ffffffff82c1f146>] ? rest_init+0xda/0xda
> [   27.564974] ---[ end trace f78f9f0651ffcb0b ]---
> 

The reason why batman-adv it raising this warning is because this call is
returning NULL:

dev_get_by_index(&init_net, net_dev->iflink);

net_dev is an interface that has been registered now and batman-adv is trying to
analyse it to decide if it is a potential candidate for its virtual device or
not.

To the best of my knowledge, if the function above is returning NULL, it means
that the iflink attribute contains a broken value.

Am I wrong or iflink should never contain 0? If there is no parent device it
should contain the same value of ifindex. Right?


Regards,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-03-30 11:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-30  9:36 WARNING: at net/batman-adv/hard-interface.c:92 batadv_is_on_batman_iface() Fengguang Wu
2013-03-30 11:52 ` Antonio Quartulli [this message]
2013-03-30 17:07   ` [PATCH] ip_gre: don't overwrite iflink during net_dev init Antonio Quartulli
2013-03-30 21:29     ` David Miller

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=20130330115245.GA4024@ritirata.org \
    --to=ordex@autistici.org \
    --cc=davem@davemloft.net \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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).