1. 21 5月, 2012 2 次提交
    • N
      md: allow a reshape operation to be reversed. · 2c810cdd
      NeilBrown 提交于
      Currently a reshape operation always progresses from the start
      of the array to the end unless the number of devices is being
      reduced, in which case it progressed in the opposite direction.
      
      To reverse a partial reshape which changes the number of devices
      you can stop the array and re-assemble with the raid-disks numbers
      reversed and it will undo.
      
      However for a reshape that does not change the number of devices
      it is not possible to reverse the reshape in the middle - you have to
      wait until it completes.
      
      So add a 'reshape_direction' attribute with is either 'forwards' or
      'backwards' and can be explicitly set when delta_disks is zero.
      
      This will become more important when we allow the data_offset to
      change in a reshape.  Then the explicit statement of what direction is
      being used will be more useful.
      
      This can be enabled in raid5 trivially as it already supports
      reverse reshape and just needs to use a different trigger to request it.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      2c810cdd
    • S
      md: using GFP_NOIO to allocate bio for flush request · b5e1b8ce
      Shaohua Li 提交于
      A flush request is usually issued in transaction commit code path, so
      using GFP_KERNEL to allocate memory for flush request bio falls into
      the classic deadlock issue.
      
      This is suitable for any -stable kernel to which it applies as it
      avoids a possible deadlock.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      b5e1b8ce
  2. 19 5月, 2012 1 次提交
    • N
      md/raid10: fix transcription error in calc_sectors conversion. · b0d634d5
      NeilBrown 提交于
      The old code was
      		sector_div(stride, fc);
      the new code was
      		sector_dir(size, conf->near_copies);
      
      'size' is right (the stride various wasn't really needed), but
      'fc' means 'far_copies', and that is an important difference.
      
      Signed-off-by: NeilBrown <neilb@suse.de>       
      b0d634d5
  3. 17 5月, 2012 2 次提交
    • J
      MD: Add del_timer_sync to mddev_suspend (fix nasty panic) · 0d9f4f13
      Jonathan Brassow 提交于
      Use del_timer_sync to remove timer before mddev_suspend finishes.
      
      We don't want a timer going off after an mddev_suspend is called.  This is
      especially true with device-mapper, since it can call the destructor function
      immediately following a suspend.  This results in the removal (kfree) of the
      structures upon which the timer depends - resulting in a very ugly panic.
      Therefore, we add a del_timer_sync to mddev_suspend to prevent this.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NNeilBrown <neilb@suse.de>
      0d9f4f13
    • N
      md/raid10: set dev_sectors properly when resizing devices in array. · 6508fdbf
      NeilBrown 提交于
      raid10 stores dev_sectors in 'conf' separately from the one in
      'mddev' because it can have a very significant effect on block
      addressing and so need to be updated carefully.
      
      However raid10_resize isn't updating it at all!
      
      To update it correctly, we need to make sure it is a proper
      multiple of the chunksize taking various details of the layout
      in to account.
      This calculation is currently done in setup_conf.   So split it
      out from there and call it from raid10_resize as well.
      Then set conf->dev_sectors properly.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      6508fdbf
  4. 04 5月, 2012 1 次提交
  5. 24 4月, 2012 3 次提交
    • N
      md: fix possible corruption of array metadata on shutdown. · 30b8aa91
      NeilBrown 提交于
      commit c744a65c
        md: don't set md arrays to readonly on shutdown.
      
      removed the possibility of a 'BUG' when data is written to an array
      that has just been switched to read-only, but also introduced the
      possibility that the array metadata could be corrupted.
      
      If, when md_notify_reboot gets the mddev lock, the array is
      in a state where it is assembled but hasn't been started (as can
      happen if the personality module is not available, or in other unusual
      situations), then incorrect metadata will be written out making it
      impossible to re-assemble the array.
      
      So only call __md_stop_writes() if the array has actually been
      activated.
      
      This patch is needed for any stable kernel which has had the above
      commit applied.
      
      Cc: stable@vger.kernel.org
      Reported-by: NChristoph Nelles <evilazrael@evilazrael.de>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      30b8aa91
    • N
      md: don't call ->add_disk unless there is good reason. · ed209584
      NeilBrown 提交于
      Commit 7bfec5f3
      
         md/raid5: If there is a spare and a want_replacement device, start replacement.
      
      cause md_check_recovery to call ->add_disk much more often.
      Instead of only when the array is degraded, it is now called whenever
      md_check_recovery finds anything useful to do, which includes
      updating the metadata for clean<->dirty transition.
      This causes unnecessary work, and causes info messages from ->add_disk
      to be reported much too often.
      
      So refine md_check_recovery to only do any actual recovery checking
      (including ->add_disk) if MD_RECOVERY_NEEDED is set.
      
      This fix is suitable for 3.3.y:
      
      Cc: stable@vger.kernel.org
      Reported-by: NJan Ceuleers <jan.ceuleers@computer.org>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      ed209584
    • J
      DM RAID: Use safe version of rdev_for_each · a9ad8526
      Jonathan Brassow 提交于
      Fix segfault caused by using rdev_for_each instead of rdev_for_each_safe
      
      Commit dafb20fa mistakenly replaced a safe
      iterator with an unsafe one when making some macro changes.
      Signed-off-by: NJonathan Brassow <jbrassow@redhat.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      a9ad8526
  6. 12 4月, 2012 3 次提交
  7. 03 4月, 2012 5 次提交
  8. 02 4月, 2012 3 次提交
  9. 29 3月, 2012 20 次提交