[dm-devel] dm-cache bug when using the cleaner?

thornber at redhat.com thornber at redhat.com
Tue Mar 5 16:52:49 UTC 2013


Hi Darrick,

You're using it correctly and have found a bug, thanks!  This patch fixes it:

  https://github.com/jthornber/linux-2.6/commit/6bbc70ab77ab828f1fecd8a3f4776b344eedef24

This is the test scenario I use (tweaked to catch your issue).

  def wait_for_all_clean(cache)
    cache.event_tracker.wait(cache) do |cache|
      status = CacheStatus.new(cache)
      STDERR.puts "#{status.nr_dirty} dirty blocks"
      status.nr_dirty == 0
    end
  end

  def test_cleaner_policy
    with_standard_cache(:format => true) do |cache|
      git_prepare(cache, :ext4)

      cache.pause do
        table = cache.active_table
        table.targets[0].args[5] = 'cleaner'
        cache.load(table)
      end

      wait_for_all_clean(cache)

      cache.pause do
        table = cache.active_table
        table.targets[0].args[5] = 'mq'
        cache.load(table)
      end

      status = CacheStatus.new(cache)
      assert_equal(0, status.nr_dirty)
    end

    # We should be able to use the origin directly now                                                                       
    with_standard_linear do |origin|
      fs = FS::file_system(:ext4, origin)
      fs.with_mount('./kernel_builds', :discard => true) do
        # triggers fsck                                                                                                      
      end
    end
  end




More information about the dm-devel mailing list