1. 09 1月, 2014 21 次提交
  2. 17 12月, 2013 10 次提交
  3. 14 12月, 2013 2 次提交
    • J
      dm array: fix a reference counting bug in shadow_ablock · ed9571f0
      Joe Thornber 提交于
      An old array block could have its reference count decremented below
      zero when it is being replaced in the btree by a new array block.
      
      The fix is to increment the old ablock's reference count just before
      inserting a new ablock into the btree.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org # 3.9+
      ed9571f0
    • J
      dm space map: disallow decrementing a reference count below zero · 5b564d80
      Joe Thornber 提交于
      The old behaviour, returning -EINVAL if a ref_count of 0 would be
      decremented, was removed in commit f722063e ("dm space map: optimise
      sm_ll_dec and sm_ll_inc").  To fix this regression we return an error
      code from the mutator function pointer passed to sm_ll_mutate() and have
      dec_ref_count() return -EINVAL if the old ref_count is 0.
      
      Add a DMERR to reflect the potential seriousness of this error.
      
      Also, add missing dm_tm_unlock() to sm_ll_mutate()'s error path.
      
      With this fix the following dmts regression test now passes:
       dmtest run --suite cache -n /metadata_use_kernel/
      
      The next patch fixes the higher-level dm-array code that exposed this
      regression.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org # 3.12+
      5b564d80
  4. 11 12月, 2013 7 次提交
    • M
      dm stats: initialize read-only module parameter · 76f5bee5
      Mikulas Patocka 提交于
      The module parameter stats_current_allocated_bytes in dm-mod is
      read-only.  This parameter informs the user about memory
      consumption.  It is not supposed to be changed by the user.
      
      However, despite being read-only, this parameter can be set on
      modprobe or insmod command line:
      modprobe dm-mod stats_current_allocated_bytes=12345
      
      The kernel doesn't expect that this variable can be non-zero at module
      initialization and if the user sets it, it results in warning.
      
      This patch initializes the variable in the module init routine, so
      that user-supplied value is ignored.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org # 3.12+
      76f5bee5
    • M
      dm bufio: initialize read-only module parameters · 4cb57ab4
      Mikulas Patocka 提交于
      Some module parameters in dm-bufio are read-only. These parameters
      inform the user about memory consumption. They are not supposed to be
      changed by the user.
      
      However, despite being read-only, these parameters can be set on
      modprobe or insmod command line, for example:
      modprobe dm-bufio current_allocated_bytes=12345
      
      The kernel doesn't expect that these variables can be non-zero at module
      initialization and if the user sets them, it results in BUG.
      
      This patch initializes the variables in the module init routine, so that
      user-supplied values are ignored.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org # 3.2+
      4cb57ab4
    • V
      dm cache: actually resize cache · 08844800
      Vincent Pelletier 提交于
      Commit f494a9c6 ("dm cache: cache
      shrinking support") broke cache resizing support.
      
      dm_cache_resize() is called with cache->cache_size before it gets
      updated to new_size, so it is a no-op.  But the dm-cache superblock is
      updated with the new_size even though the backing dm-array is not
      resized.  Fix this by passing the new_size to dm_cache_resize().
      Signed-off-by: NVincent Pelletier <plr.vincent@gmail.com>
      Acked-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      08844800
    • J
      dm cache policy mq: fix promotions to occur as expected · af95e7a6
      Joe Thornber 提交于
      Micro benchmarks that repeatedly issued IO to a single block were
      failing to cause a promotion from the origin device to the cache.  Fix
      this by not updating the stats during map() if -EWOULDBLOCK will be
      returned.
      
      The mq policy will only update stats, consider migration, etc, once per
      tick period (a unit of time established between dm-cache core and the
      policies).
      
      When the IO thread calls the policy's map method, if it would like to
      migrate the associated block it returns -EWOULDBLOCK, the IO then gets
      handed over to a worker thread which handles the migration.  The worker
      thread calls map again, to check the migration is still needed (avoids a
      race among other things).  *BUT*, before this fix, if we were still in
      the same tick period the stats were already updated by the previous map
      call -- so the migration would no longer be requested.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      af95e7a6
    • J
      dm thin: allow pool in read-only mode to transition to read-write mode · 9b7aaa64
      Joe Thornber 提交于
      A thin-pool may be in read-only mode because the pool's data or metadata
      space was exhausted.  To allow for recovery, by adding more space to the
      pool, we must allow a pool to transition from PM_READ_ONLY to PM_WRITE
      mode.  Otherwise, running out of space will render the pool permanently
      read-only.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      9b7aaa64
    • J
      dm thin: re-establish read-only state when switching to fail mode · 5383ef3a
      Joe Thornber 提交于
      If the thin-pool transitioned to fail mode and the thin-pool's table
      were reloaded for some reason: the new table's default pool mode would
      be read-write, though it will transition to fail mode during resume.
      
      When the pool mode transitions directly from PM_WRITE to PM_FAIL we need
      to re-establish the intermediate read-only state in both the metadata
      and persistent-data block manager (as is usually done with the normal
      pool mode transition sequence: PM_WRITE -> PM_READ_ONLY -> PM_FAIL).
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      5383ef3a
    • J
      dm thin: always fallback the pool mode if commit fails · 020cc3b5
      Joe Thornber 提交于
      Rename commit_or_fallback() to commit().  Now all previous calls to
      commit() will trigger the pool mode to fallback if the commit fails.
      
      Also, check the error returned from commit() in alloc_data_block().
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      020cc3b5