]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix extent leak after main device expand. 34022/head
authorIgor Fedotov <ifedotov@suse.com>
Wed, 18 Mar 2020 11:35:55 +0000 (14:35 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 18 Mar 2020 12:53:17 +0000 (15:53 +0300)
To reproduce the issue one can expand device of 3,147,480,064 bytes to
4,147,480,064 using bluefs-bdev-expand command.
Subsequent fsck will detect the leakage.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BitmapFreelistManager.cc

index 7dcef4384adb1058f8832581b8e08eb69fe4ec57..13c60b4962e8949adea4415863d5522bfdad936a 100644 (file)
@@ -111,11 +111,11 @@ int BitmapFreelistManager::expand(uint64_t new_size, KeyValueDB::Transaction txn
 
   uint64_t blocks0 = size / bytes_per_block;
   if (blocks0 / blocks_per_key * blocks_per_key != blocks0) {
-    blocks0 = (blocks / blocks_per_key + 1) * blocks_per_key;
+    blocks0 = (blocks0 / blocks_per_key + 1) * blocks_per_key;
     dout(10) << __func__ << " rounding blocks up from 0x" << std::hex << size
             << " to 0x" << (blocks0 * bytes_per_block)
             << " (0x" << blocks0 << " blocks)" << std::dec << dendl;
-    // reset past-eof blocks to unallocated
+    // reset previous past-eof blocks to unallocated
     _xor(size, blocks0 * bytes_per_block - size, txn);
   }