Hi Sowmini,

[auto build test ERROR on net-next/master]

url:    
https://github.com/0day-ci/linux/commits/Sowmini-Varadhan/neigh-Really-delete-an-arp-neigh-entry-on-ip-neigh-delete-or-arp-d/20170531-235737
config: i386-randconfig-a0-05311518 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from include/linux/srcu.h:33:0,
                    from include/linux/notifier.h:15,
                    from include/linux/memory_hotplug.h:6,
                    from include/linux/mmzone.h:757,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from net/core/neighbour.c:20:
   net/core/neighbour.c: In function 'neigh_del':
>> net/core/neighbour.c:130:25: error: 'tbl' undeclared (first use in this 
>> function)
           lockdep_is_held(&tbl->lock)));
                            ^
   include/linux/rcupdate.h:637:36: note: in definition of macro 
'rcu_assign_pointer'
     uintptr_t _r_a_p__v = (uintptr_t)(v);          \
                                       ^
   include/linux/rcupdate.h:587:2: note: in expansion of macro 
'RCU_LOCKDEP_WARN'
     RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
     ^
   include/linux/rcupdate.h:751:2: note: in expansion of macro 
'__rcu_dereference_protected'
     __rcu_dereference_protected((p), (c), __rcu)
     ^
   net/core/neighbour.c:129:8: note: in expansion of macro 
'rcu_dereference_protected'
           rcu_dereference_protected(n->next,
           ^
   net/core/neighbour.c:130:8: note: in expansion of macro 'lockdep_is_held'
           lockdep_is_held(&tbl->lock)));
           ^
   net/core/neighbour.c:130:25: note: each undeclared identifier is reported 
only once for each function it appears in
           lockdep_is_held(&tbl->lock)));
                            ^
   include/linux/rcupdate.h:637:36: note: in definition of macro 
'rcu_assign_pointer'
     uintptr_t _r_a_p__v = (uintptr_t)(v);          \
                                       ^
   include/linux/rcupdate.h:587:2: note: in expansion of macro 
'RCU_LOCKDEP_WARN'
     RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
     ^
   include/linux/rcupdate.h:751:2: note: in expansion of macro 
'__rcu_dereference_protected'
     __rcu_dereference_protected((p), (c), __rcu)
     ^
   net/core/neighbour.c:129:8: note: in expansion of macro 
'rcu_dereference_protected'
           rcu_dereference_protected(n->next,
           ^
   net/core/neighbour.c:130:8: note: in expansion of macro 'lockdep_is_held'
           lockdep_is_held(&tbl->lock)));
           ^

vim +/tbl +130 net/core/neighbour.c

    14   *      Vitaly E. Lavrov        releasing NULL neighbor in neigh_add.
    15   *      Harald Welte            Add neighbour cache statistics like 
rtstat
    16   */
    17  
    18  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    19  
  > 20  #include <linux/slab.h>
    21  #include <linux/types.h>
    22  #include <linux/kernel.h>
    23  #include <linux/module.h>
    24  #include <linux/socket.h>
    25  #include <linux/netdevice.h>
    26  #include <linux/proc_fs.h>
    27  #ifdef CONFIG_SYSCTL
    28  #include <linux/sysctl.h>
    29  #endif
    30  #include <linux/times.h>
    31  #include <net/net_namespace.h>
    32  #include <net/neighbour.h>
    33  #include <net/dst.h>
    34  #include <net/sock.h>
    35  #include <net/netevent.h>
    36  #include <net/netlink.h>
    37  #include <linux/rtnetlink.h>
    38  #include <linux/random.h>
    39  #include <linux/string.h>
    40  #include <linux/log2.h>
    41  #include <linux/inetdevice.h>
    42  #include <net/addrconf.h>
    43  
    44  #define DEBUG
    45  #define NEIGH_DEBUG 1
    46  #define neigh_dbg(level, fmt, ...)              \
    47  do {                                            \
    48          if (level <= NEIGH_DEBUG)               \
    49                  pr_debug(fmt, ##__VA_ARGS__);   \
    50  } while (0)
    51  
    52  #define PNEIGH_HASHMASK         0xF
    53  
    54  static void neigh_timer_handler(unsigned long arg);
    55  static void __neigh_notify(struct neighbour *n, int type, int flags,
    56                             u32 pid);
    57  static void neigh_update_notify(struct neighbour *neigh, u32 nlmsg_pid);
    58  static int pneigh_ifdown(struct neigh_table *tbl, struct net_device 
*dev);
    59  
    60  #ifdef CONFIG_PROC_FS
    61  static const struct file_operations neigh_stat_seq_fops;
    62  #endif
    63  
    64  /*
    65     Neighbour hash table buckets are protected with rwlock tbl->lock.
    66  
    67     - All the scans/updates to hash buckets MUST be made under this lock.
    68     - NOTHING clever should be made under this lock: no callbacks
    69       to protocol backends, no attempts to send something to network.
    70       It will result in deadlocks, if backend/driver wants to use 
neighbour
    71       cache.
    72     - If the entry requires some non-trivial actions, increase
    73       its reference count and release table lock.
    74  
    75     Neighbour entries are protected:
    76     - with reference count.
    77     - with rwlock neigh->lock
    78  
    79     Reference count prevents destruction.
    80  
    81     neigh->lock mainly serializes ll address data and its validity state.
    82     However, the same lock is used to protect another entry fields:
    83      - timer
    84      - resolution queue
    85  
    86     Again, nothing clever shall be made under neigh->lock,
    87     the most complicated procedure, which we allow is dev->hard_header.
    88     It is supposed, that dev->hard_header is simplistic and does
    89     not make callbacks to neighbour tables.
    90   */
    91  
    92  static int neigh_blackhole(struct neighbour *neigh, struct sk_buff *skb)
    93  {
    94          kfree_skb(skb);
    95          return -ENETDOWN;
    96  }
    97  
    98  static void neigh_cleanup_and_release(struct neighbour *neigh)
    99  {
   100          if (neigh->parms->neigh_cleanup)
   101                  neigh->parms->neigh_cleanup(neigh);
   102  
   103          __neigh_notify(neigh, RTM_DELNEIGH, 0, 0);
   104          call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
   105          neigh_release(neigh);
   106  }
   107  
   108  /*
   109   * It is random distribution in the interval (1/2)*base...(3/2)*base.
   110   * It corresponds to default IPv6 settings and is not overridable,
   111   * because it is really reasonable choice.
   112   */
   113  
   114  unsigned long neigh_rand_reach_time(unsigned long base)
   115  {
   116          return base ? (prandom_u32() % base) + (base >> 1) : 0;
   117  }
   118  EXPORT_SYMBOL(neigh_rand_reach_time);
   119  
   120  
   121  static bool neigh_del(struct neighbour *n, __u8 state,
   122                        struct neighbour __rcu **np)
   123  {
   124          bool retval = false;
   125  
   126          write_lock(&n->lock);
   127          if (atomic_read(&n->refcnt) == 1 && !(n->nud_state & state)) {
   128                  rcu_assign_pointer(*np,
   129                                     rcu_dereference_protected(n->next,
 > 130                                     lockdep_is_held(&tbl->lock)));
   131                  n->dead = 1;
   132                  retval = true;
   133          }

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to