]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: make fsck() can catch uninitialized sbid too
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Nov 2016 07:25:03 +0000 (15:25 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 15 Nov 2016 00:30:13 +0000 (08:30 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index ba8ef9c51c81e58a684b58e40d56d88bb40d9a29..2d065e0334b8d95c815cd647ac95de389b620b38 100644 (file)
@@ -4533,7 +4533,12 @@ int BlueStore::fsck(bool deep)
                 << " sbid " << blob.sbid << " > blobid_max "
                 << blobid_max << dendl;
            ++errors;
-         }
+         } else if (blob.sbid == 0) {
+            derr << __func__ << " " << oid << " blob " << blob
+                 << " marked as shared but has uninitialized sbid"
+                 << dendl;
+            ++errors;
+          }
          sb_info_t& sbi = sb_info[blob.sbid];
          sbi.sb = i.first->shared_blob;
          sbi.oids.push_back(oid);