1. 03 Jul, 2012 18 commits
    • Linus Torvalds's avatar
      Merge tag 'md-3.5-fixes' of git://neil.brown.name/md · 2fb748d2
      Linus Torvalds authored
      Pull md fixes from NeilBrown:
       "md: collection of bug fixes for 3.5
      
        You go away for 2 weeks vacation and what do you get when you come
        back? Piles of bugs :-)
      
        Some found by inspection, some by testing, some during use in the
        field, and some while developing for the next window..."
      
      * tag 'md-3.5-fixes' of git://neil.brown.name/md:
        md: fix up plugging (again).
        md: support re-add of recovering devices.
        md/raid1: fix bug in read_balance introduced by hot-replace
        raid5: delayed stripe fix
        md/raid456: When read error cannot be recovered, record bad block
        md: make 'name' arg to md_register_thread non-optional.
        md/raid10: fix failure when trying to repair a read error.
        md/raid5: fix refcount problem when blocked_rdev is set.
        md:Add blk_plug in sync_thread.
        md/raid5: In ops_run_io, inc nr_pending before calling md_wait_for_blocked_rdev
        md/raid5: Do not add data_offset before call to is_badblock
        md/raid5: prefer replacing failed devices over want-replacement devices.
        md/raid10: Don't try to recovery unmatched (and unused) chunks.
      2fb748d2
    • Linus Torvalds's avatar
      Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 3bfd2454
      Linus Torvalds authored
      Pull security layer fixes from James Morris.
      
      A documentation update, and a nommu build fix.
      
      * 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        security: Fix nommu build.
        security: document no_new_privs
      3bfd2454
    • Paul Mundt's avatar
      security: Fix nommu build. · 75331a59
      Paul Mundt authored
      The security + nommu configuration presently blows up with an undefined
      reference to BDI_CAP_EXEC_MAP:
      
      security/security.c: In function 'mmap_prot':
      security/security.c:687:36: error: dereferencing pointer to incomplete type
      security/security.c:688:16: error: 'BDI_CAP_EXEC_MAP' undeclared (first use in this function)
      security/security.c:688:16: note: each undeclared identifier is reported only once for each function it appears in
      
      include backing-dev.h directly to fix it up.
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      75331a59
    • NeilBrown's avatar
      md: fix up plugging (again). · b357f04a
      NeilBrown authored
      The value returned by "mddev_check_plug" is only valid until the
      next 'schedule' as that will unplug things.  This could happen at any
      call to mempool_alloc.
      So just calling mddev_check_plug at the start doesn't really make
      sense.
      
      So call it just before, or just after, queuing things for the thread.
      As the action that happens at unplug is to wake the thread, this makes
      lots of sense.
      If we cannot add a plug (which requires a small GFP_ATOMIC alloc) we
      wake thread immediately.
      
      RAID5 is a bit different.  Requests are queued for the thread and the
      thread is woken by release_stripe.  So we don't need to wake the
      thread on failure.
      However the thread doesn't perform certain actions when there is any
      active plug, so it is important to install a plug before waking the
      thread.  So for RAID5 we install the plug *before* queuing the request
      and waking the thread.
      
      Without this patch it is possible for raid1 or raid10 to queue a
      request without then waking the thread, resulting in the array locking
      up.
      
      Also change raid10 to only flush_pending_write when there are not
      active plugs, just like raid1.
      
      This patch is suitable for 3.0 or later.  I plan to submit it to
      -stable, but I'll like to let it spend a few weeks in mainline
      first to be sure it is completely safe.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      b357f04a
    • 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
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 9d4056aa
      Linus Torvalds authored
      Pull a couple more powerpc fixes from Benjamin Herrenschmidt:
       "Here are two more fixes that I "missed" when scrubbing patchwork last
        week which are worth still having in 3.5."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/kvm: sldi should be sld
        powerpc/xmon: Use cpumask iterator to avoid warning
      9d4056aa
    • Andy Lutomirski's avatar
      security: document no_new_privs · 09b24357
      Andy Lutomirski authored
      Document no_new_privs.
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      09b24357
    • 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. 02 Jul, 2012 2 commits
    • Michael Neuling's avatar
      powerpc/kvm: sldi should be sld · 2f584a14
      Michael Neuling authored
      Since we are taking a registers, this should never have been an sldi.
      Talking to paulus offline, this is the correct fix.
      
      Was introduced by:
       commit 19ccb76a
       Author: Paul Mackerras <paulus@samba.org>
       Date:   Sat Jul 23 17:42:46 2011 +1000
      
      Talking to paulus, this shouldn't be a literal.
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      CC: <stable@kernel.org> [v3.2+]
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2f584a14
    • Anton Blanchard's avatar
      powerpc/xmon: Use cpumask iterator to avoid warning · bc1d7702
      Anton Blanchard authored
      We have a bug report where the kernel hits a warning in the cpumask
      code:
      
      WARNING: at include/linux/cpumask.h:107
      
      Which is:
              WARN_ON_ONCE(cpu >= nr_cpumask_bits);
      
      The backtrace is:
              cpu_cmd
              cmds
              xmon_core
              xmon
              die
      
      xmon is iterating through 0 to NR_CPUS. I'm not sure why we are still
      open coding this but iterating above nr_cpu_ids is definitely a bug.
      
      This patch iterates through all possible cpus, in case we issue a
      system reset and CPUs in an offline state call in.
      
      Perhaps the old code was trying to handle CPUs that were in the
      partition but were never started (eg kexec into a kernel with an
      nr_cpus= boot option). They are going to die way before we get into
      xmon since we haven't set any kernel state up for them.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      CC: <stable@kernel.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bc1d7702
  3. 01 Jul, 2012 2 commits
  4. 30 Jun, 2012 13 commits
  5. 29 Jun, 2012 5 commits