]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Something may be wrong with _do_write_small.
authoramoxic <amoxic@126.com>
Fri, 9 Sep 2016 07:49:00 +0000 (07:49 +0000)
committeramoxic <amoxic@126.com>
Fri, 9 Sep 2016 07:49:00 +0000 (07:49 +0000)
  The statement "if (ep->logical_offset + b->get_blob().get_ondisk_length() <= offset)" which try to judge if the writing offset is in the current Blob may be wrong.

Signed-off-by: feng yu amoxic@126.com
src/os/bluestore/BlueStore.cc

index f09b22faeaba3096f1f05a110b2439b1cbe5801e..93a98302ae544d6eeab7ec01f0c34098490a744b 100644 (file)
@@ -6964,7 +6964,7 @@ void BlueStore::_do_write_small(
   if (ep != o->extent_map.extent_map.begin()) {
     --ep;
     b = ep->blob;
-    if (ep->logical_offset + b->get_blob().get_ondisk_length() <= offset) {
+    if ((ep->logical_offset - ep->blob_offset) + b->get_blob().get_ondisk_length() <= offset) {
       ++ep;
     }
   }