1. 14 11月, 2009 7 次提交
  2. 12 11月, 2009 7 次提交
    • A
      net/atm: move all compat_ioctl handling to atm/ioctl.c · 805003a4
      Arnd Bergmann 提交于
      We have two implementations of the compat_ioctl handling for ATM, the
      one that we have had for ages in fs/compat_ioctl.c and the one added to
      net/atm/ioctl.c by David Woodhouse. Unfortunately, both versions are
      incomplete, and in practice we use a very confusing combination of the
      two.
      
      For ioctl numbers that have the same identifier on 32 and 64 bit systems,
      we go directly through the compat_ioctl socket operation, for those that
      
      differ, we do a conversion in fs/compat_ioctl.c.
      
      This patch moves both variants into the vcc_compat_ioctl() function,
      while preserving the current behaviour. It also kills off the COMPATIBLE_IOCTL
      definitions that we never use here.
      Doing it this way is clearly not a good solution, but I hope it is a
      step into the right direction, so that someone is able to clean up this
      mess for real.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      805003a4
    • A
      net/compat: fix dev_ifsioc emulation corner cases · a2116ed2
      Arnd Bergmann 提交于
      Handling for SIOCSHWTSTAMP is broken on architectures
      with a split user/kernel address space like s390,
      because it passes a real user pointer while using
      set_fs(KERNEL_DS).
      A similar problem might arise the next time somebody
      adds code to dev_ifsioc.
      
      Split up dev_ifsioc into three separate functions for
      SIOCSHWTSTAMP, SIOC*IFMAP and all other numbers so
      we can get rid of set_fs in all potentially affected
      cases.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Patrick Ohly <patrick.ohly@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a2116ed2
    • S
      decnet: convert dndev_lock to spinlock · e5c140a3
      stephen hemminger 提交于
      There is no reason for this lock to be reader/writer since
      the reader only has lock held for a very brief period.
      The overhead of read_lock is more expensive than spinlock.
      
      Compile tested only, I am not a decnet user.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5c140a3
    • S
      decnet: add RTNL lock when reading address list · 41bdecf1
      stephen hemminger 提交于
      Add missing locking in the case of auto binding to the
      default device. The address list might change while this code is looking
      at the list.
      
      Compile tested only, I am not a decnet user.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41bdecf1
    • S
      netdev: fold name hash properly (v3) · 08e9897d
      stephen hemminger 提交于
      The full_name_hash function does not produce well distributed values in
      the lower bits, so most code uses hash_32() to fold it.  This is really
      a bug introduced when name hashing was added, back in 2.5 when I added
      name hashing.
      
      hash_32 is all that is needed since full_name_hash returns unsigned int
      which is only 32 bits on 64 bit platforms.
      
      Also, there is no point in using hash_32 on ifindex, because the is naturally
      sequential and usually well distributed.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      08e9897d
    • A
      skbuff: Do not allow skb recycling with disabled IRQs · e84af6dd
      Anton Vorontsov 提交于
      NAPI drivers try to recycle SKBs in their polling routine, but we
      generally don't know the context in which the polling will be called,
      and the skb recycling itself may require IRQs to be enabled.
      
      This patch adds irqs_disabled() test to the skb_recycle_check()
      routine, so that we'll not let the drivers hit the skb recycling
      path with IRQs disabled.
      
      As a side effect, this patch actually disables skb recycling for some
      [broken] drivers. E.g. gianfar driver grabs an irqsave spinlock during
      TX ring processing, and then tries to recycle an skb, and that caused
      the following badness:
      
      nf_conntrack version 0.5.0 (1008 buckets, 4032 max)
      ------------[ cut here ]------------
      Badness at kernel/softirq.c:143
      NIP: c003e3c4 LR: c423a528 CTR: c003e344
      ...
      NIP [c003e3c4] local_bh_enable+0x80/0xc4
      LR [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
      Call Trace:
      [c15d1b60] [c003e32c] local_bh_disable+0x1c/0x34 (unreliable)
      [c15d1b70] [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
      [c15d1b80] [c02c6370] nf_conntrack_destroy+0x3c/0x70
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e84af6dd
    • D
      ipv6: Remove unused var in inet6_dump_ifinfo() · 434a8a58
      David S. Miller 提交于
      Reported by Stephen Rothwell:
      
      --------------------
      Today's linux-next build (x86_64 allmodconfig) produced this warning:
      
      net/ipv6/addrconf.c: In function 'inet6_dump_ifinfo':
      net/ipv6/addrconf.c:3833: warning: unused variable 'err'
      
      Introduced by commit 84d2697d ("ipv6:
      speedup inet6_dump_ifinfo()").
      --------------------
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      434a8a58
  3. 11 11月, 2009 13 次提交
  4. 09 11月, 2009 12 次提交
  5. 08 11月, 2009 1 次提交
    • E
      net: Support specifying the network namespace upon device creation. · 81adee47
      Eric W. Biederman 提交于
      There is no good reason to not support userspace specifying the
      network namespace during device creation, and it makes it easier
      to create a network device and pass it to a child network namespace
      with a well known name.
      
      We have to be careful to ensure that the target network namespace
      for the new device exists through the life of the call.  To keep
      that logic clear I have factored out the network namespace grabbing
      logic into rtnl_link_get_net.
      
      In addtion we need to continue to pass the source network namespace
      to the rtnl_link_ops.newlink method so that we can find the base
      device source network namespace.
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      81adee47