1. 19 6月, 2007 10 次提交
    • N
      SCTP: Fix sctp_getsockopt_get_peer_addrs · 186e2343
      Neil Horman 提交于
      	This is the split out of the patch that we agreed I should split
      out from my last patch.  It changes space_left to be computed in the same
      way the to variable is.  I know we talked about changing space_left to an
      int, but I think size_t is more appropriate, since we should never have
      negative space in our buffer, and computing using offsetof means space_left
      should now never drop below zero.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NSridhar Samudrala <sri@us.ibm.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      186e2343
    • N
      SCTP: update sctp_getsockopt helpers to allow oversized buffers · 408f22e8
      Neil Horman 提交于
      	I noted the other day while looking at a bug that was ostensibly
      in some perl networking library, that we strictly avoid allowing getsockopt
      operations to complete if we pass in oversized buffers.  This seems to make
      libraries like Perl::NET malfunction since it seems to allocate oversized
      buffers for use in several operations.  It also seems to be out of line with
      the way udp, tcp and ip getsockopt routines handle buffer input (since the
      *optlen pointer in both an input and an output and gets set to the length
      of the data that we copy into the buffer).  This patch brings our getsockopt
      helpers into line with other protocols, and allows us to accept oversized
      buffers for our getsockopt operations.  Tested by me with good results.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NSridhar Samudrala <sri@us.ibm.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      408f22e8
    • D
      [AF_RXRPC]: Return the number of bytes buffered in rxrpc_send_data() · 19e6454c
      David Howells 提交于
      Return the number of bytes buffered in rxrpc_send_data().
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      19e6454c
    • N
      [IPVS]: Fix state variable on failure to start ipvs threads · cc0191ae
      Neil Horman 提交于
      ip_vs currently fails to reset its ip_vs_sync_state variable if the
      sync thread fails to start properly.  The result is that the kernel
      will report a running daemon when their actuall is none.
      
      If you issue the following commands:
      
      1. ipvsadm --start-daemon master --mcast-interface bla
      2. ipvsadm -L --daemon
      3. ipvsadm --stop-daemon master
      
      Assuming that bla is not an actual interface, step 2 should return no
      data, but instead returns:
      
      $ ipvsadm -L --daemon
      master sync daemon (mcast=bla, syncid=0)
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc0191ae
    • P
      [XFRM]: Fix MTU calculation for non-ESP SAs · 28121617
      Patrick McHardy 提交于
      My IPsec MTU optimization patch introduced a regression in MTU calculation
      for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if
      the transform doesn't provide a ->get_mtu() function.
      Reported-and-tested-by: NMarco Berizzi <pupilla@hotmail.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28121617
    • L
      Fix possible runqueue lock starvation in wait_task_inactive() · fa490cfd
      Linus Torvalds 提交于
      Miklos Szeredi reported very long pauses (several seconds, sometimes
      more) on his T60 (with a Core2Duo) which he managed to track down to
      wait_task_inactive()'s open-coded busy-loop.
      
      He observed that an interrupt on one core tries to acquire the
      runqueue-lock but does not succeed in doing so for a very long time -
      while wait_task_inactive() on the other core loops waiting for the first
      core to deschedule a task (which it wont do while spinning in an
      interrupt handler).
      
      This rewrites wait_task_inactive() to do all its waiting optimistically
      without any locks taken at all, and then just double-check the end
      result with the proper runqueue lock held over just a very short
      section.  If there were races in the optimistic wait, of a preemption
      event scheduled the process away, we simply re-synchronize, and start
      over.
      
      So the code now looks like this:
      
      	repeat:
      		/* Unlocked, optimistic looping! */
      		rq = task_rq(p);
      		while (task_running(rq, p))
      			cpu_relax();
      
      		/* Get the *real* values */
      		rq = task_rq_lock(p, &flags);
      		running = task_running(rq, p);
      		array = p->array;
      		task_rq_unlock(rq, &flags);
      
      		/* Check them.. */
      		if (unlikely(running)) {
      			cpu_relax();
      			goto repeat;
      		}
      
      		/* Preempted away? Yield if so.. */
      		if (unlikely(array)) {
      			yield();
      			goto repeat;
      		}
      
      Basically, that first "while()" loop is done entirely without any
      locking at all (and doesn't check for the case where the target process
      might have been preempted away), and so it's possibly "incorrect", but
      we don't really care.  Both the runqueue used, and the "task_running()"
      check might be the wrong tests, but they won't oops - they just mean
      that we could possibly get the wrong results due to lack of locking and
      exit the loop early in the case of a race condition.
      
      So once we've exited the loop, we then get the proper (and careful) rq
      lock, and check the running/runnable state _safely_.  And if it turns
      out that our quick-and-dirty and unsafe loop was wrong after all, we
      just go back and try it all again.
      
      (The patch also adds a lot of comments, which is the actual bulk of it
      all, to make it more obvious why we can do these things without holding
      the locks).
      
      Thanks to Miklos for all the testing and tracking it down.
      Tested-by: NMiklos Szeredi <miklos@szeredi.hu>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fa490cfd
    • I
      sched: fix SysRq-N (normalize RT tasks) · a0f98a1c
      Ingo Molnar 提交于
      Gene Heskett reported the following problem while testing CFS: SysRq-N
      is not always effective in normalizing tasks back to SCHED_OTHER.
      
      The reason for that turns out to be the following bug:
      
       - normalize_rt_tasks() uses for_each_process() to iterate through all
         tasks in the system.  The problem is, this method does not iterate
         through all tasks, it iterates through all thread groups.
      
      The proper mechanism to enumerate over all threads is to use a
      do_each_thread() + while_each_thread() loop.
      Reported-by: NGene Heskett <gene.heskett@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0f98a1c
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 · 4cc21505
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
        [SCSI] ESP: Don't forget to clear ESP_FLAG_RESETTING.
        [SCSI] fusion: fix for BZ 8426 - massive slowdown on SCSI CD/DVD drive
      4cc21505
    • B
      Fix signalfd interaction with thread-private signals · caec4e8d
      Benjamin Herrenschmidt 提交于
      Don't let signalfd dequeue private signals off other threads (in the
      case of things like SIGILL or SIGSEGV, trying to do so would result
      in undefined behaviour on who actually gets the signal, since they
      are force unblocked).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NDavide Libenzi <davidel@xmailserver.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caec4e8d
    • T
      Revert "futex_requeue_pi optimization" · bd197234
      Thomas Gleixner 提交于
      This reverts commit d0aa7a70.
      
      It not only introduced user space visible changes to the futex syscall,
      it is also non-functional and there is no way to fix it proper before
      the 2.6.22 release.
      
      The breakage report ( http://lkml.org/lkml/2007/5/12/17 ) went
      unanswered, and unfortunately it turned out that the concept is not
      feasible at all.  It violates the rtmutex semantics badly by introducing
      a virtual owner, which hacks around the coupling of the user-space
      pi_futex and the kernel internal rt_mutex representation.
      
      At the moment the only safe option is to remove it fully as it contains
      user-space visible changes to broken kernel code, which we do not want
      to expose in the 2.6.22 release.
      
      The patch reverts the original patch mostly 1:1, but contains a couple
      of trivial manual cleanups which were necessary due to patches, which
      touched the same area of code later.
      
      Verified against the glibc tests and my own PI futex tests.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NUlrich Drepper <drepper@redhat.com>
      Cc: Pierre Peiffer <pierre.peiffer@bull.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd197234
  2. 17 6月, 2007 24 次提交
  3. 16 6月, 2007 6 次提交
    • L
      Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 · de7f928c
      Linus Torvalds 提交于
      * master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
        ide-scsi: fix OOPS in idescsi_expiry()
        Resume from RAM on HPC nx6325 broken
      de7f928c
    • B
      ide-scsi: fix OOPS in idescsi_expiry() · d1be0a82
      Bartlomiej Zolnierkiewicz 提交于
      drive->driver_data contains pointer to Scsi_Host not idescsi_scsi_t.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d1be0a82
    • R
      Resume from RAM on HPC nx6325 broken · ce9b2b0a
      Rafael J. Wysocki 提交于
      generic_ide_resume() should check if dev->driver is not NULL before applying
      to_ide_driver() to it.  Fix that.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ce9b2b0a
    • L
      Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 · fa04a008
      Linus Torvalds 提交于
      * 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
        [RXRPC] net/rxrpc/ar-connection.c: fix NULL dereference
        [TCP]: Fix logic breakage due to DSACK separation
        [TCP]: Congestion control API RTT sampling fix
      fa04a008
    • P
      mm: Fix memory/cpu hotplug section mismatch and oops. · d09c6b80
      Paul Mundt 提交于
      When building with memory hotplug enabled and cpu hotplug disabled, we
      end up with the following section mismatch:
      
      WARNING: mm/built-in.o(.text+0x4e58): Section mismatch: reference to
      .init.text: (between 'free_area_init_node' and '__build_all_zonelists')
      
      This happens as a result of:
      
              -> free_area_init_node()
                -> free_area_init_core()
                  -> zone_pcp_init() <-- all __meminit up to this point
                    -> zone_batchsize() <-- marked as __cpuinit                     fo
      
      This happens because CONFIG_HOTPLUG_CPU=n sets __cpuinit to __init, but
      CONFIG_MEMORY_HOTPLUG=y unsets __meminit.
      
      Changing zone_batchsize() to __devinit fixes this.
      
      __devinit is the only thing that is common between CONFIG_HOTPLUG_CPU=y and
      CONFIG_MEMORY_HOTPLUG=y. In the long run, perhaps this should be moved to
      another section identifier completely. Without this, memory hot-add
      of offline nodes (via hotadd_new_pgdat()) will oops if CPU hotplug is
      not also enabled.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NYasunori Goto <y-goto@jp.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      
      --
      
       mm/page_alloc.c |    2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      d09c6b80
    • L
      Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 · 902233ee
      Linus Torvalds 提交于
      * 'master' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (30 commits)
        Blackfin SMC91X ethernet supporting driver: SMC91C111 LEDs are note drived in the kernel like in uboot
        Blackfin SPI driver: fix bug SPI DMA incomplete transmission
        Blackfin SPI driver: tweak spi cleanup function to match newer kernel changes
        Blackfin RTC drivers: update MAINTAINERS information
        Blackfin serial driver: decouple PARODD and CMSPAR checking from PARENB
        Blackfin serial driver: actually implement the break_ctl() function
        Blackfin serial driver: ignore framing and parity errors
        Blackfin serial driver: hook up our UARTs STP bit with userspaces CMSPAR
        Blackfin arch: move HI/LO macros into blackfin.h and punt the rest of macros.h as it includes VDSP macros we never use
        Blackfin arch: redo our linker script a bit
        Blackfin arch: make sure we initialize our L1 Data B section properly based on the linked kernel
        Blackfin arch: fix bug can not wakeup from sleep via push buttons
        Blackfin arch: add support for Alon Bar-Lev's dynamic kernel command-line
        Blackfin arch: add missing gpio.h header to fix compiling in some pm configurations
        Blackfin arch: As Mike pointed out range goes form m..MAX_BLACKFIN_GPIO -1
        Blackfin arch: fix spelling typo in output
        Blackfin arch: try to split up functions like this into smaller units according to LKML review
        Blackfin arch: add proper ENDPROC()
        Blackfin arch: move more of our startup code to .init so it can be freed once we are up and running
        Blackfin arch: unify differences between our diff head.S files -- no functional changes
        ...
      902233ee