From ab59bcd8fd5b21398a54df3ea28e3aa89e918538 Mon Sep 17 00:00:00 2001 From: Steven McDonald Date: Fri, 30 May 2014 13:32:02 +1000 Subject: [PATCH] Fix the block maps for data ranges The existing code uses the underlying data blocks as keys, and the origin blocks as values, which is backwards. This is done correctly above for the single mapping case, so this bug only affects range mappings. --- lib/lvm/thin_snapshot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lvm/thin_snapshot.rb b/lib/lvm/thin_snapshot.rb index 6dbdada..bacb013 100644 --- a/lib/lvm/thin_snapshot.rb +++ b/lib/lvm/thin_snapshot.rb @@ -172,7 +172,7 @@ def vg_block_dump len = r.attribute('length').value.to_i ori = r.attribute('origin_begin').value.to_i dat = r.attribute('data_begin').value.to_i - h2[(dat..dat+len-1)] = (ori..ori+len-1) + h2[(ori..ori+len-1)] = (dat..dat+len-1) end h2