1. 27 7月, 2015 2 次提交
  2. 24 7月, 2015 6 次提交
  3. 23 7月, 2015 1 次提交
    • G
      md: Skip cluster setup for dm-raid · d3b178ad
      Goldwyn Rodrigues 提交于
      There is a bug that the bitmap superblock isn't initialised properly for
      dm-raid, so a new field can have garbage in new fields.
      (dm-raid does initialisation in the kernel - md initialised the
       superblock in mdadm).
      
      This means that for dm-raid we cannot currently trust the new ->nodes
      field. So:
       - use __GFP_ZERO to initialise the superblock properly for all new
          arrays
       - initialise all fields in bitmap_info in bitmap_new_disk_sb
       - ignore ->nodes for dm arrays (yes, this is a hack)
      
      This bug exposes dm-raid to bug in the (still experimental) md-cluster
      code, so it is suitable for -stable.  It does cause crashes.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=100491
      Cc: stable@vger.kernel.org (v4.1)
      Signed-off-By: NGoldwyn Rodrigues <rgoldwyn@suse.com>
      Signed-off-by: NNeilBrown <neilb@suse.com>
      d3b178ad
  4. 22 7月, 2015 3 次提交
    • N
      md: flush ->event_work before stopping array. · ee5d004f
      NeilBrown 提交于
      The 'event_work' worker used by dm-raid may still be running
      when the array is stopped.  This can result in an oops.
      
      So flush the workqueue on which it is run after detaching
      and before destroying the device.
      Reported-by: NHeinz Mauelshagen <heinzm@redhat.com>
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Cc: stable@vger.kernel.org (2.6.38+ please delay 2 weeks after -final release)
      Fixes: 9d09e663 ("dm: raid456 basic support")
      ee5d004f
    • N
      md/raid10: always set reshape_safe when initializing reshape_position. · 299b0685
      NeilBrown 提交于
      'reshape_position' tracks where in the reshape we have reached.
      'reshape_safe' tracks where in the reshape we have safely recorded
      in the metadata.
      
      These are compared to determine when to update the metadata.
      So it is important that reshape_safe is initialised properly.
      Currently it isn't.  When starting a reshape from the beginning
      it usually has the correct value by luck.  But when reducing the
      number of devices in a RAID10, it has the wrong value and this leads
      to the metadata not being updated correctly.
      This can lead to corruption if the reshape is not allowed to complete.
      
      This patch is suitable for any -stable kernel which supports RAID10
      reshape, which is 3.5 and later.
      
      Fixes: 3ea7daa5 ("md/raid10: add reshape support")
      Cc: stable@vger.kernel.org (v3.5+ please wait for -final to be out for 2 weeks)
      Signed-off-by: NNeilBrown <neilb@suse.com>
      299b0685
    • N
      md/raid5: avoid races when changing cache size. · 2d5b569b
      NeilBrown 提交于
      Cache size can grow or shrink due to various pressures at
      any time.  So when we resize the cache as part of a 'grow'
      operation (i.e. change the size to allow more devices) we need
      to blocks that automatic growing/shrinking.
      
      So introduce a mutex.  auto grow/shrink uses mutex_trylock()
      and just doesn't bother if there is a blockage.
      Resizing the whole cache holds the mutex to ensure that
      the correct number of new stripes is allocated.
      
      This bug can result in some stripes not being freed when an
      array is stopped.  This leads to the kmem_cache not being
      freed and a subsequent array can try to use the same kmem_cache
      and get confused.
      
      Fixes: edbe83ab ("md/raid5: allow the stripe_cache to grow and shrink.")
      Cc: stable@vger.kernel.org (4.1 - please delay until 2 weeks after release of 4.2)
      Signed-off-by: NNeilBrown <neilb@suse.com>
      2d5b569b
  5. 17 7月, 2015 3 次提交
  6. 16 7月, 2015 3 次提交
    • M
      dm cache: display 'needs_check' in status if it is set · 255eac20
      Mike Snitzer 提交于
      There is currently no way to see that the needs_check flag has been set
      in the metadata.  Display 'needs_check' in the cache status if it is set
      in the cache metadata.
      
      Also, update cache documentation.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      255eac20
    • M
      dm thin: display 'needs_check' in status if it is set · e4c78e21
      Mike Snitzer 提交于
      There is currently no way to see that the needs_check flag has been set
      in the metadata.  Display 'needs_check' in the thin-pool status if it is
      set in the thinp metadata.
      
      Also, update thinp documentation.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      e4c78e21
    • M
      dm thin: stay in out-of-data-space mode once no_space_timeout expires · bcc696fa
      Mike Snitzer 提交于
      This fixes an issue where running out of data space would cause the
      thin-pool's metadata to become read-only.  There was no reason to make
      metadata read-only -- calling set_pool_mode() with PM_READ_ONLY was a
      misguided way to error all queued and future write IOs.  We can
      accomplish the same by degrading from PM_OUT_OF_DATA_SPACE to
      PM_OUT_OF_DATA_SPACE with error_if_no_space enabled.
      
      Otherwise, the use of PM_READ_ONLY could cause a race where commit() was
      started before the PM_READ_ONLY transition but dm_pool_commit_metadata()
      would go on to fail because the block manager had transitioned to
      read-only.  The return of -EPERM from dm_pool_commit_metadata(), due to
      attempting to commit while in read-only mode, caused the thin-pool to
      set 'needs_check' because a metadata_operation_failed().  This needless
      cascade of failures makes life for users more difficult than needed.
      Reported-by: NVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      bcc696fa
  7. 13 7月, 2015 1 次提交
    • M
      dm: fix use after free crash due to incorrect cleanup sequence · b06075a9
      Mikulas Patocka 提交于
      Linux 4.2-rc1 Commit 0f20972f ("dm: factor out a common
      cleanup_mapped_device()") moved a common cleanup code to a separate
      function.  Unfortunately, that commit incorrectly changed the order of
      cleanup, so that it destroys the mapped_device's srcu structure
      'io_barrier' before destroying its workqueue.
      
      The function that is executed on the workqueue (dm_wq_work) uses the srcu
      structure, thus it may use it after being freed.  That results in a
      crash in the LVM test suite's mirror-vgreduce-removemissing.sh test.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Fixes: 0f20972f ("dm: factor out a common cleanup_mapped_device()")
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      b06075a9
  8. 11 7月, 2015 1 次提交
  9. 09 7月, 2015 1 次提交
  10. 06 7月, 2015 3 次提交
  11. 01 7月, 2015 2 次提交
  12. 26 6月, 2015 4 次提交
  13. 25 6月, 2015 3 次提交
    • N
      md: clear Blocked flag on failed devices when array is read-only. · ab16bfc7
      Neil Brown 提交于
      The Blocked flag indicates that a device has failed but that this
      fact hasn't been recorded in the metadata yet.  Writes to such
      devices cannot be allowed until the metadata has been updated.
      
      On a read-only array, the Blocked flag will never be cleared.
      This prevents the device being removed from the array.
      
      If the metadata is being handled by the kernel
      (i.e. !mddev->external), then we can be sure that if the array is
      switch to writable, then a metadata update will happen and will
      record the failure.  So we don't need the flag set.
      
      If metadata is externally managed, it is upto the external manager
      to clear the 'blocked' flag.
      Reported-by: NXiaoNi <xni@redhat.com>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      ab16bfc7
    • N
      md: unlock mddev_lock on an error path. · 9a8c0fa8
      NeilBrown 提交于
      This error path retuns while still holding the lock - bad.
      
      Fixes: 6791875e ("md: make reconfig_mutex optional for writes to md sysfs files.")
      Cc: stable@vger.kernel.org (v4.0+)
      Signed-off-by: NNeilBrown <neilb@suse.com>
      9a8c0fa8
    • N
      md: clear mddev->private when it has been freed. · bd691922
      NeilBrown 提交于
      If ->private is set when ->run is called, it is assumed to be
      a 'config'  prepared as part of 'reshape'.
      
      So it is important when we free that config, that we also clear ->private.
      This is not often a problem as the mddev will normally be discarded
      shortly after the config us freed.
      However if an 'assemble' races with a final close, the assemble can use
      the old mddev which has a stale ->private.  This leads to any of
      various sorts of crashes.
      
      So clear ->private after calling ->free().
      Reported-by: NNate Clark <nate@neworld.us>
      Cc: stable@vger.kernel.org (v4.0+)
      Fixes: afa0f557 ("md: rename ->stop to ->free")
      Signed-off-by: NNeilBrown <neilb@suse.com>
      bd691922
  14. 24 6月, 2015 2 次提交
  15. 18 6月, 2015 5 次提交