Skip to content
  1. Jul 03, 2012
    • NeilBrown's avatar
      md: support re-add of recovering devices. · f4563091
      NeilBrown authored
      
      
      We currently only allow a device to be re-added if it appear to be
      in-sync.  This is overly restrictive as it may be desirable to re-add
      a device that is in the middle of recovery.
      
      So remove the test for "InSync" - the test on rdev->raid_disk is
      sufficient to ensure that the re-add will succeed.
      
      Reported-by: default avatarAlexander Lyakas <alex.bolshoy@gmail.com>
      Tested-by: default avatarAlexander Lyakas <alex.bolshoy@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      f4563091
    • NeilBrown's avatar
      md/raid1: fix bug in read_balance introduced by hot-replace · 32644afd
      NeilBrown authored
      
      
      When we added hot_replace we doubled the number of devices
      that could be in a RAID1 array.  So we doubled how far read_balance
      would search.  Unfortunately we didn't double the point at which
      it looped back to the beginning - so it effectively loops over
      all non-replacement disks twice.
      This doesn't cause bad behaviour, but it pointless and means we
      never read from replacement devices.
      
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      32644afd
    • Shaohua Li's avatar
      raid5: delayed stripe fix · fab363b5
      Shaohua Li authored
      
      
      There isn't locking setting STRIPE_DELAYED and STRIPE_PREREAD_ACTIVE bits, but
      the two bits have relationship. A delayed stripe can be moved to hold list only
      when preread active stripe count is below IO_THRESHOLD. If a stripe has both
      the bits set, such stripe will be in delayed list and preread count not 0,
      which will make such stripe never leave delayed list.
      
      Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      fab363b5
    • majianpeng's avatar
      md/raid456: When read error cannot be recovered, record bad block · 2e8ac303
      majianpeng authored
      
      
      We may not be able to fix a bad block if:
       - the array is degraded
       - the over-write fails.
      
      In these cases we currently eject the device, but we should
      record a bad block if possible.
      
      Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      2e8ac303
    • NeilBrown's avatar
      md: make 'name' arg to md_register_thread non-optional. · 0232605d
      NeilBrown authored
      
      
      Having the 'name' arg optional and defaulting to the current
      personality name is no necessary and leads to errors, as when
      changing the level of an array we can end up using the
      name of the old level instead of the new one.
      
      So make it non-optional and always explicitly pass the name
      of the level that the array will be.
      
      Reported-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      0232605d
    • NeilBrown's avatar
      md/raid10: fix failure when trying to repair a read error. · 055d3747
      NeilBrown authored
      commit 58c54fcc
      
      
           md/raid10: handle further errors during fix_read_error better.
      
      in 3.1 added "r10_sync_page_io" which takes an IO size in sectors.
      But we were passing the IO size in bytes!!!
      This resulting in bio_add_page failing, and empty request being sent
      down, and a consequent BUG_ON in scsi_lib.
      
      [fix missing space in error message at same time]
      
      This fix is suitable for 3.1.y and later.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarChristian Balzer <chibi@gol.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      055d3747
    • NeilBrown's avatar
      md/raid5: fix refcount problem when blocked_rdev is set. · 5f066c63
      NeilBrown authored
      commit 43220aa0
      
      
          md/raid5: fix a hang on device failure.
      
      fixed a hang, but introduced a refcounting in-balance so
      that if the presence of bad-blocks ever caused an rdev to
      be 'blocked' we would increment the refcount on the rdev and
      never decrement it.
      
      So added the needed rdev_dec_pending when md_wait_for_blocked_rdev
      is not called.
      
      Reported-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      5f066c63
    • majianpeng's avatar
      md:Add blk_plug in sync_thread. · 7c2c57c9
      majianpeng authored
      
      
      Add blk_plug in sync_thread will increase the performance of sync.
      Because sync_thread did not blk_plug,so when raid sync, the bio merge
      not well.
      
      Testing environment:
      SATA controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI
      Controller.
      OS:Linux xxx 3.5.0-rc2+ #340 SMP Tue Jun 12 09:00:25 CST 2012
      x86_64 x86_64 x86_64 GNU/Linux.
      RAID5: four ST31000524NS disk.
      
      Without blk_plug:recovery speed about 63M/Sec;
      Add blk_plug:recovery speed about 120M/Sec.
      
      Using blktrace:
      blktrace -d /dev/sdb -w 60  -o -|blkparse -i -
      
      without blk_plug:
      Total (8,16):
       Reads Queued:      309811,     1239MiB	 Writes Queued:           0,        0KiB
       Read Dispatches:   283583,     1189MiB	 Write Dispatches:        0,        0KiB
       Reads Requeued:         0		 Writes Requeued:         0
       Reads Completed:   273351,     1149MiB	 Writes Completed:        0,        0KiB
       Read Merges:        23533,    94132KiB	 Write Merges:            0,        0KiB
       IO unplugs:             0        	 Timer unplugs:           0
      
      add blk_plug:
      Total (8,16):
       Reads Queued:      428697,     1714MiB	 Writes Queued:           0,        0KiB
       Read Dispatches:     3954,     1714MiB	 Write Dispatches:        0,        0KiB
       Reads Requeued:         0		 Writes Requeued:         0
       Reads Completed:     3956,     1715MiB	 Writes Completed:        0,        0KiB
       Read Merges:       424743,     1698MiB	 Write Merges:            0,        0KiB
       IO unplugs:             0        	 Timer unplugs:        3384
      
      The ratio of merge will be markedly increased.
      
      Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      7c2c57c9
    • majianpeng's avatar
      md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev · 1850753d
      majianpeng authored
      In ops_run_io(), the call to md_wait_for_blocked_rdev will decrement
      nr_pending so we lose the reference we hold on the rdev.
      So atomic_inc it first to maintain the reference.
      
      This bug was introduced by commit  73e92e51
      
      
          md/raid5.  Don't write to known bad block on doubtful devices.
      
      which appeared in 3.0, so patch is suitable for stable kernels since
      then.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      1850753d
    • majianpeng's avatar
      md/raid5: Do not add data_offset before call to is_badblock · 6c0544e2
      majianpeng authored
      In chunk_aligned_read() we are adding data_offset before calling
      is_badblock.  But is_badblock also adds data_offset, so that is bad.
      
      So move the addition of data_offset to after the call to
      is_badblock.
      
      This bug was introduced by commit 31c176ec
      
      
           md/raid5: avoid reading from known bad blocks.
      which first appeared in 3.0.  So that patch is suitable for any
      -stable kernel from 3.0.y onwards.  However it will need minor
      revision for most of those (as the comment didn't appear until
      recently).
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      6c0544e2
    • NeilBrown's avatar
      md/raid5: prefer replacing failed devices over want-replacement devices. · 5cfb22a1
      NeilBrown authored
      
      
      If a RAID5 has both a failed device and a device marked as
      'WantReplacement', then we should preferentially replace the failed
      device.
      However the current code replaces whichever is found first.
      So split into 2 loops, check fail failed/missing first, and only check
      for WantReplacement if nothing is failed or missing.
      
      Reported-by: default avatarmajianpeng <majianpeng@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      5cfb22a1
    • NeilBrown's avatar
      md/raid10: Don't try to recovery unmatched (and unused) chunks. · fc448a18
      NeilBrown authored
      
      
      If a RAID10 has an odd number of chunks - as might happen when there
      are an odd number of devices - the last chunk has no pair and so is
      not mirrored.  We don't store data there, but when recovering the last
      device in an array we retry to recover that last chunk from a
      non-existent location.  This results in an error, and the recovery
      aborts.
      
      When we get to that last chunk we should just stop - there is nothing
      more to do anyway.
      
      This bug has been present since the introduction of RAID10, so the
      patch is appropriate for any -stable kernel.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarChristian Balzer <chibi@gol.com>
      Tested-by: default avatarChristian Balzer <chibi@gol.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      fc448a18
  2. Jun 25, 2012
  3. Jun 24, 2012
  4. Jun 23, 2012
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 002b758b
      Linus Torvalds authored
      Pull Ceph fixes from Sage Weil:
       "There are a couple of fixes from Yan for bad pointer dereferences in
        the messenger code and when fiddling with page->private after page
        migration, a fix from Alex for a use-after-free in the osd client
        code, and a couple fixes for the message refcounting and shutdown
        ordering."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        libceph: flush msgr queue during mon_client shutdown
        rbd: Clear ceph_msg->bio_iter for retransmitted message
        libceph: use con get/put ops from osd_client
        libceph: osd_client: don't drop reply reference too early
        ceph: check PG_Private flag before accessing page->private
      002b758b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-Jun-21-2012' of git://oss.sgi.com/xfs/xfs · 369c4f54
      Linus Torvalds authored
      Pull XFS fixes from Ben Myers:
       - Fix stale data exposure with unwritten extents
       - Fix a warning in xfs_alloc_vextent with ODEBUG
       - Fix overallocation and alignment of pages for xfs_bufs
       - Fix a cursor leak
       - Fix a log hang
       - Fix a crash related to xfs_sync_worker
       - Rename xfs log structure from struct log to struct xlog so we can use
         crash dumps effectively
      
      * tag 'for-linus-Jun-21-2012' of git://oss.sgi.com/xfs/xfs:
        xfs: rename log structure to xlog
        xfs: shutdown xfs_sync_worker before the log
        xfs: Fix overallocation in xfs_buf_allocate_memory()
        xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
        xfs: check for stale inode before acquiring iflock on push
        xfs: fix debug_object WARN at xfs_alloc_vextent()
        xfs: xfs_vm_writepage clear iomap_valid when !buffer_uptodate (REV2)
      369c4f54
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a1163719
      Linus Torvalds authored
      Pull perf updates from Ingo Molnar.
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ftrace: Make all inline tags also include notrace
        perf: Use css_tryget() to avoid propping up css refcount
        perf tools: Fix synthesizing tracepoint names from the perf.data headers
        perf stat: Fix default output file
        perf tools: Fix endianity swapping for adds_features bitmask
      a1163719
  5. Jun 22, 2012