1. 19 Jul, 2012 13 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 85efc72a
      Linus Torvalds authored
      Pull last minute Ceph fixes from Sage Weil:
       "The important one fixes a bug in the socket failure handling behavior
        that was turned up in some recent failure injection testing.  The
        other two are minor bug fixes."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        rbd: endian bug in rbd_req_cb()
        rbd: Fix ceph_snap_context size calculation
        libceph: fix messenger retry
      85efc72a
    • Linus Torvalds's avatar
      Merge tag 'md-3.5-fixes' of git://neil.brown.name/md · 3e4b9459
      Linus Torvalds authored
      Pull three md bugfixes from NeilBrown:
       "One of the bugs was introduced in 3.5-rc1.  Others have been there for
        longer."
      
      * tag 'md-3.5-fixes' of git://neil.brown.name/md:
        md/raid1: close some possible races on write errors during resync
        md: avoid crash when stopping md array races with closing other open fds.
        md: fix bug in handling of new_data_offset
      3e4b9459
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 309d4b00
      Linus Torvalds authored
      Pull networking changes from David Miller:
       "Ok, we should be good to go now"
      
      1) We have to statically initialize the init_net device list head rather
         than do so in an initcall, otherwise netprio_cgroup crashes if it's
         built statically rather than modular (Mark D.  Rustad)
      
      2) Fix SKB null oopser in CIPSO ipv4 option processing (Paul Moore)
      
      3) Qlogic maintainers update (Anirban Chakraborty)
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: Statically initialize init_net.dev_base_head
        MAINTAINERS: Changes in qlcnic and qlge maintainers list
        cipso: don't follow a NULL pointer when setsockopt() is called
      309d4b00
    • Linus Torvalds's avatar
      Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 61c901c5
      Linus Torvalds authored
      Pull HID update from Jiri Kosina:
       "A final round of changes for HID for 3.5: just device ID additions."
      
      * 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: hid-multitouch: add support for Zytronic panels
        HID: add Sennheiser BTD500USB device support
        HID: add battery quirk for Apple Wireless ANSI
      61c901c5
    • Ezequiel Garcia's avatar
      cx25821: Remove bad strcpy to read-only char* · 380e99fc
      Ezequiel Garcia authored
      The strcpy was being used to set the name of the board.  Since the
      destination char* was read-only and the name is set statically at
      compile time; this was both wrong and redundant.
      
      The type of char* is changed to const char* to prevent future errors.
      Reported-by: default avatarRadek Masin <radek@masin.eu>
      Signed-off-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
      [ Taking directly due to vacations   - Linus ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      380e99fc
    • Benjamin Tissoires's avatar
    • NeilBrown's avatar
      md/raid1: close some possible races on write errors during resync · 58e94ae1
      NeilBrown authored
      commit 4367af55
         md/raid1: clear bad-block record when write succeeds.
      
      Added a 'reschedule_retry' call possibility at the end of
      end_sync_write, but didn't add matching code at the end of
      sync_request_write.  So if the writes complete very quickly, or
      scheduling makes it seem that way, then we can miss rescheduling
      the request and the resync could hang.
      
      Also commit 73d5c38a
          md: avoid races when stopping resync.
      
      Fix a race condition in this same code in end_sync_write but didn't
      make the change in sync_request_write.
      
      This patch updates sync_request_write to fix both of those.
      Patch is suitable for 3.1 and later kernels.
      Reported-by: default avatarAlexander Lyakas <alex.bolshoy@gmail.com>
      Original-version-by: default avatarAlexander Lyakas <alex.bolshoy@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      58e94ae1
    • NeilBrown's avatar
      md: avoid crash when stopping md array races with closing other open fds. · a05b7ea0
      NeilBrown authored
      md will refuse to stop an array if any other fd (or mounted fs) is
      using it.
      When any fs is unmounted of when the last open fd is closed all
      pending IO will be flushed (e.g. sync_blockdev call in __blkdev_put)
      so there will be no pending IO to worry about when the array is
      stopped.
      
      However in order to send the STOP_ARRAY ioctl to stop the array one
      must first get and open fd on the block device.
      If some fd is being used to write to the block device and it is closed
      after mdadm open the block device, but before mdadm issues the
      STOP_ARRAY ioctl, then there will be no last-close on the md device so
      __blkdev_put will not call sync_blockdev.
      
      If this happens, then IO can still be in-flight while md tears down
      the array and bad things can happen (use-after-free and subsequent
      havoc).
      
      So in the case where do_md_stop is being called from an open file
      descriptor, call sync_block after taking the mutex to ensure there
      will be no new openers.
      
      This is needed when setting a read-write device to read-only too.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      a05b7ea0
    • NeilBrown's avatar
      md: fix bug in handling of new_data_offset · 25f7fd47
      NeilBrown authored
      commit c6563a8c
          md: add possibility to change data-offset for devices.
      
      introduced a 'new_data_offset' attribute which should normally
      be the same as 'data_offset', but can be explicitly set to a different
      value to allow a reshape operation to move the data.
      
      Unfortunately when the 'data_offset' is explicitly set through
      sysfs, the new_data_offset is not also set, so the two would become
      out-of-sync incorrectly.
      
      One result of this is that trying to set the 'size' after the
      'data_offset' would fail because it is not permitted to set the size
      when the 'data_offset' and 'new_data_offset' are different - as that
      can be confusing.
      Consequently when mdadm tried to do this while assembling an IMSM
      array it would fail.
      
      This bug was introduced in 3.5-rc1.
      Reported-by: default avatarBrian Downing <bdowning@lavos.net>
      Bisected-by: default avatarBrian Downing <bdowning@lavos.net>
      Tested-by: default avatarBrian Downing <bdowning@lavos.net>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      25f7fd47
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 8a7298b7
      Linus Torvalds authored
      Pull target fixes from Nicholas Bellinger:
       "This includes a bugfix from MDR to address a NULL pointer OOPs with
        FCoE aborts, along with a WRITE_SAME emulation bugfix for NOLB=0
        cases, and persistent reservation return cleanups from Roland.
      
        All three patches are CC'ed to stable."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: Fix range calculation in WRITE SAME emulation when num blocks == 0
        target: Clean up returning errors in PR handling code
        tcm_fc: Fix crash seen with aborts and large reads
      8a7298b7
    • Olaf Hering's avatar
      kexec: update URL of kexec homepage · b1bdd2eb
      Olaf Hering authored
      The referenced html file does not exist anymore. Replace the URL with
      the current project homepage.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1bdd2eb
    • Yoichi Yuasa's avatar
      mips: fix bug.h build regression · 893a0574
      Yoichi Yuasa authored
      Commit 37778088 ("bug.h: need linux/kernel.h for TAINT_WARN.") broke
      all MIPS builds:
      
          CC      arch/mips/kernel/machine_kexec.o
        include/linux/log2.h: In function '__ilog2_u32':
        include/linux/log2.h:34:2: error: implicit declaration of function 'fls' [-Werror=implicit-function-declaration]
        include/linux/log2.h: In function '__ilog2_u64':
        include/linux/log2.h:42:2: error: implicit declaration of function 'fls64' [-Werror=implicit-function-declaration]
        ...
      Signed-off-by: default avatarYoichi Yuasa <yuasa@linux-mips.org>
      Tested-by: default avatarJohn Crispin <blogic@openwrt.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      893a0574
    • Linus Torvalds's avatar
      Make wait_for_device_probe() also do scsi_complete_async_scans() · eea03c20
      Linus Torvalds authored
      Commit a7a20d10 ("sd: limit the scope of the async probe domain")
      make the SCSI device probing run device discovery in it's own async
      domain.
      
      However, as a result, the partition detection was no longer synchronized
      by async_synchronize_full() (which, despite the name, only synchronizes
      the global async space, not all of them).  Which in turn meant that
      "wait_for_device_probe()" would not wait for the SCSI partitions to be
      parsed.
      
      And "wait_for_device_probe()" was what the boot time init code relied on
      for mounting the root filesystem.
      
      Now, most people never noticed this, because not only is it
      timing-dependent, but modern distributions all use initrd.  So the root
      filesystem isn't actually on a disk at all.  And then before they
      actually mount the final disk filesystem, they will have loaded the
      scsi-wait-scan module, which not only does the expected
      wait_for_device_probe(), but also does scsi_complete_async_scans().
      
      [ Side note: scsi_complete_async_scans() had also been partially broken,
        but that was fixed in commit 43a8d39d ("fix async probe
        regression"), so that same commit a7a20d10 had actually broken
        setups even if you used scsi-wait-scan explicitly ]
      
      Solve this problem by just moving the scsi_complete_async_scans() call
      into wait_for_device_probe().  Everybody who wants to wait for device
      probing to finish really wants the SCSI probing to complete, so there's
      no reason not to do this.
      
      So now "wait_for_device_probe()" really does what the name implies, and
      properly waits for device probing to finish.  This also removes the now
      unnecessary extra calls to scsi_complete_async_scans().
      Reported-and-tested-by: default avatarArtem S. Tashkinov <t.artem@mailcity.com>
      Cc: Dan Williams <dan.j.williams@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <jbottomley@parallels.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: linux-scsi <linux-scsi@vger.kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      eea03c20
  2. 18 Jul, 2012 23 commits
  3. 17 Jul, 2012 4 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (Andrew's patch-bomb) · de74646c
      Linus Torvalds authored
      Merge Andrew's remaining patches for 3.5:
       "Nine fixes"
      
      * Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (9 commits)
        mm: fix lost kswapd wakeup in kswapd_stop()
        m32r: make memset() global for CONFIG_KERNEL_BZIP2=y
        m32r: add memcpy() for CONFIG_KERNEL_GZIP=y
        m32r: consistently use "suffix-$(...)"
        m32r: fix 'fix breakage from "m32r: use generic ptrace_resume code"' fallout
        m32r: fix pull clearing RESTORE_SIGMASK into block_sigmask() fallout
        m32r: remove duplicate definition of PTRACE_O_TRACESYSGOOD
        mn10300: fix "pull clearing RESTORE_SIGMASK into block_sigmask()" fallout
        bootmem: make ___alloc_bootmem_node_nopanic() really nopanic
      de74646c
    • Aaditya Kumar's avatar
      mm: fix lost kswapd wakeup in kswapd_stop() · 1c7e7f6c
      Aaditya Kumar authored
      Offlining memory may block forever, waiting for kswapd() to wake up
      because kswapd() does not check the event kthread->should_stop before
      sleeping.
      
      The proper pattern, from Documentation/memory-barriers.txt, is:
      
         ---  waker  ---
         event_indicated = 1;
         wake_up_process(event_daemon);
      
         ---  sleeper  ---
         for (;;) {
            set_current_state(TASK_UNINTERRUPTIBLE);
            if (event_indicated)
               break;
            schedule();
         }
      
         set_current_state() may be wrapped by:
            prepare_to_wait();
      
      In the kswapd() case, event_indicated is kthread->should_stop.
      
        === offlining memory (waker) ===
         kswapd_stop()
            kthread_stop()
               kthread->should_stop = 1
               wake_up_process()
               wait_for_completion()
      
        ===  kswapd_try_to_sleep (sleeper) ===
         kswapd_try_to_sleep()
            prepare_to_wait()
                 .
                 .
            schedule()
                 .
                 .
            finish_wait()
      
      The schedule() needs to be protected by a test of kthread->should_stop,
      which is wrapped by kthread_should_stop().
      
      Reproducer:
         Do heavy file I/O in background.
         Do a memory offline/online in a tight loop
      Signed-off-by: default avatarAaditya Kumar <aaditya.kumar@ap.sony.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
      Acked-by: default avatarMel Gorman <mel@csn.ul.ie>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c7e7f6c
    • Geert Uytterhoeven's avatar
      m32r: make memset() global for CONFIG_KERNEL_BZIP2=y · 9a75c6e5
      Geert Uytterhoeven authored
      Fix the m32r compile error:
      
        arch/m32r/boot/compressed/misc.c:31:14: error: static declaration of 'memset' follows non-static declaration
        make[5]: *** [arch/m32r/boot/compressed/misc.o] Error 1
        make[4]: *** [arch/m32r/boot/compressed/vmlinux] Error 2
      
      by removing the static keyword.
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9a75c6e5
    • Geert Uytterhoeven's avatar
      m32r: add memcpy() for CONFIG_KERNEL_GZIP=y · a8abbca6
      Geert Uytterhoeven authored
      Fix the m32r link error:
      
          LD      arch/m32r/boot/compressed/vmlinux
        arch/m32r/boot/compressed/misc.o: In function `zlib_updatewindow':
        misc.c:(.text+0x190): undefined reference to `memcpy'
        misc.c:(.text+0x190): relocation truncated to fit: R_M32R_26_PLTREL against undefined symbol `memcpy'
        make[5]: *** [arch/m32r/boot/compressed/vmlinux] Error 1
      
      by adding our own implementation of memcpy().
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a8abbca6