1. 06 Apr, 2007 12 commits
    • David Miller's avatar
      IPV6: Fix ipv6 round-robin locking. · 00d3a802
      David Miller authored
      [IPV6]: Fix routing round-robin locking.
      
      As per RFC2461, section 6.3.6, item #2, when no routers on the
      matching list are known to be reachable or probably reachable we
      do round robin on those available routes so that we make sure
      to probe as many of them as possible to detect when one becomes
      reachable faster.
      
      Each routing table has a rwlock protecting the tree and the linked
      list of routes at each leaf.  The round robin code executes during
      lookup and thus with the rwlock taken as a reader.  A small local
      spinlock tries to provide protection but this does not work at all
      for two reasons:
      
      1) The round-robin list manipulation, as coded, goes like this (with
         read lock held):
      
      	walk routes finding head and tail
      
      	spin_lock();
      	rotate list using head and tail
      	spin_unlock();
      
         While one thread is rotating the list, another thread can
         end up with stale values of head and tail and then proceed
         to corrupt the list when it gets the lock.  This ends up causing
         the OOPS in fib6_add() later onthat many people have been hitting.
      
      2) All the other code paths that run with the rwlock held as
         a reader do not expect the list to change on them, they
         expect it to remain completely fixed while they hold the
         lock in that way.
      
      So, simply stated, it is impossible to implement this correctly using
      a manipulation of the list without violating the rwlock locking
      semantics.
      
      Reimplement using a per-fib6_node round-robin pointer.  This way we
      don't need to manipulate the list at all, and since the round-robin
      pointer can only ever point to real existing entries we don't need
      to perform any locking on the changing of the round-robin pointer
      itself.  We only need to reset the round-robin pointer to NULL when
      the entry it is pointing to is removed.
      
      The idea is from Thomas Graf and it is very similar to how this
      was implemented before the advanced router selection code when in.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00d3a802
    • Patrick McHardy's avatar
      NET_SCHED: Fix ingress qdisc locking. · 5d50dcec
      Patrick McHardy authored
      [NET_SCHED]: Fix ingress locking
      
      Ingress queueing uses a seperate lock for serializing enqueue operations,
      but fails to properly protect itself against concurrent changes to the
      qdisc tree. Use queue_lock for now since the real fix it quite intrusive.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d50dcec
    • Patrick McHardy's avatar
      NET: Fix packet classidier NULL pointer OOPS · 04301ff6
      Patrick McHardy authored
      [NET_SCHED]: cls_basic: fix NULL pointer dereference
      
      cls_basic doesn't allocate tp->root before it is linked into the
      active classifier list, resulting in a NULL pointer dereference
      when packets hit the classifier before its ->change function is
      called.
      
      Reported by Chris Madden <chris@reflexsecurity.com>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04301ff6
    • Stefan Richter's avatar
      ieee1394: dv1394: fix CardBus card ejection · 04117289
      Stefan Richter authored
      Fix NULL pointer dereference on hot ejection of a FireWire card while
      dv1394 was loaded.  http://bugzilla.kernel.org/show_bug.cgi?id=7121
      I did not test card ejection with open /dev/dv1394 files yet.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04117289
    • Paolo 'Blaisorblade' Giarrusso's avatar
      uml: fix unreasonably long udelay · 16ad6a90
      Paolo 'Blaisorblade' Giarrusso authored
      Currently we have a confused udelay implementation.
      
      * __const_udelay does not accept usecs but xloops in i386 and x86_64
      * our implementation requires usecs as arg
      * it gets a xloops count when called by asm/arch/delay.h
      
      Bugs related to this (extremely long shutdown times) where reported by some
      x86_64 users, especially using Device Mapper.
      
      To hit this bug, a compile-time constant time parameter must be passed - that's
      why UML seems to work most times.
      Fix this with a simple udelay implementation.
      Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      16ad6a90
    • Jeff Dike's avatar
      UML - use correct register file size everywhere · 93420eaf
      Jeff Dike authored
      This patch uses MAX_REG_NR consistently to refer to the register file
      size.  FRAME_SIZE isn't sufficient because on x86_64, it is smaller
      than the ptrace register file size.  MAX_REG_NR was introduced as a
      consistent way to get the number of registers, but wasn't used
      everywhere it should be.
      
      When this causes a problem, it makes PTRACE_SETREGS fail on x86_64
      because of a corrupted segment register value in the known-good
      register file. The patch also adds a register dump at that point in
      case there are any future problems here.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      93420eaf
    • Jeff Dike's avatar
      UML - Fix static linking · b40b478e
      Jeff Dike authored
      During a static link, ld has started putting a .note section in the
      .uml.setup.init section.  This has the result that the UML setups
      begin with 32 bytes of garbage and UML crashes immediately on boot.
      
      This patch creates a specific .note section for ld to drop this stuff
      into.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b40b478e
    • Jeff Dike's avatar
      UML - host VDSO fix · 6f601709
      Jeff Dike authored
      This fixes a problem seen by a number of people running UML on newer host
      kernels.  init would hang with an infinite segfault loop.
      
      It turns out that the host kernel was providing a AT_SYSINFO_EHDR of
      0xffffe000, which faked UML into believing that the host VDSO page could be
      reused.  However, AT_SYSINFO pointed into the middle of the address space, and
      was unmapped as a result.  Because UML was providing AT_SYSINFO_EHDR and
      AT_SYSINFO to its own processes, these would branch to nowhere when trying to
      use the VDSO.
      
      The fix is to also check the location of AT_SYSINFO when deciding whether to
      use the host's VDSO.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6f601709
    • Jeff Dike's avatar
      UML - fix epoll · edfcf73f
      Jeff Dike authored
      UML/x86_64 needs the same packing of struct epoll_event as x86_64.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      edfcf73f
    • Robert Hancock's avatar
      sata_nv: delay on switching between NCQ and non-NCQ commands · 83b72f1c
      Robert Hancock authored
      sata_nv: delay on switching between NCQ and non-NCQ commands
      
      This patch appears to solve some problems with commands timing out in
      cases where an NCQ command is immediately followed by a non-NCQ command
      (or possibly vice versa). This is a rather ugly solution, but until we
      know more about why this is needed, this is about all we can do.
      
      [backport to 2.6.20 by Chuck Ebbert <cebbert@redhat.com>]
      Signed-off-by: default avatarRobert Hancock <hancockr@shaw.ca>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      83b72f1c
    • Albert Lee's avatar
      ide: remove clearing bmdma status from cdrom_decode_status() (rev #4) · 9f6a92b4
      Albert Lee authored
      ide: remove clearing bmdma status from cdrom_decode_status() (rev #4)
      
      patch 2/2:
        Remove clearing bmdma status from cdrom_decode_status() since ATA devices
        might need it as well.
      
        (http://lkml.org/lkml/2006/12/4/201 and http://lkml.org/lkml/2006/11/15/94)
      Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: "Adam W. Hawks" <awhawks@us.ibm.com>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9f6a92b4
    • Albert Lee's avatar
      ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4) · 9757c1a0
      Albert Lee authored
      ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4)
      
      patch 1/2 (revised):
      - Fix drive->waiting_for_dma to work with CDB-intr devices.
      - Do the dma status clearing in ide_intr() and add a new
        hwif->ide_dma_clear_irq for Intel ICHx controllers.
      
      Revised per Alan, Sergei and Bart's advice.
      
      Patch against 2.6.20-rc6. Tested ok on my ICH4 and pdc20275 adapters.
      Please review/apply, thanks.
      Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Adam Hawks <awhawks@us.ibm.com>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9757c1a0
  2. 23 Mar, 2007 28 commits