1. 19 Jul, 2012 3 commits
    • 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
  2. 14 Jul, 2012 11 commits
  3. 13 Jul, 2012 19 commits
  4. 12 Jul, 2012 5 commits
  5. 11 Jul, 2012 2 commits
    • Linus Torvalds's avatar
      Merge tag 'fbdev-fixes-for-3.5-2' of git://github.com/schandinat/linux-2.6 · 918227bb
      Linus Torvalds authored
      Pull fbdev fixes from Florian Tobias Schandinat:
       "Two fixes for OMAPDSS by Tomi Valkeinen:
         - one to avoid warnings when runtime PM is not enabled
         - one workaround to dependancy issues during suspend/resume"
      
      * tag 'fbdev-fixes-for-3.5-2' of git://github.com/schandinat/linux-2.6:
        OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n
        OMAPDSS: Use PM notifiers for system suspend
      918227bb
    • Linus Torvalds's avatar
      Merge branch 'akpm' (Andrew's patch-bomb) · 00c3e276
      Linus Torvalds authored
      Merge random patches from Andrew Morton.
      
      * Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (32 commits)
        memblock: free allocated memblock_reserved_regions later
        mm: sparse: fix usemap allocation above node descriptor section
        mm: sparse: fix section usemap placement calculation
        xtensa: fix incorrect memset
        shmem: cleanup shmem_add_to_page_cache
        shmem: fix negative rss in memcg memory.stat
        tmpfs: revert SEEK_DATA and SEEK_HOLE
        drivers/rtc/rtc-twl.c: fix threaded IRQ to use IRQF_ONESHOT
        fat: fix non-atomic NFS i_pos read
        MAINTAINERS: add OMAP CPUfreq driver to OMAP Power Management section
        sgi-xp: nested calls to spin_lock_irqsave()
        fs: ramfs: file-nommu: add SetPageUptodate()
        drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warning
        mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails
        h8300/uaccess: add mising __clear_user()
        h8300/uaccess: remove assignment to __gu_val in unhandled case of get_user()
        h8300/time: add missing #include <asm/irq_regs.h>
        h8300/signal: fix typo "statis"
        h8300/pgtable: add missing #include <asm-generic/pgtable.h>
        drivers/rtc/rtc-ab8500.c: ensure correct probing of the AB8500 RTC when Device Tree is enabled
        ...
      00c3e276