]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/ECTransaction.h
update sources to v12.1.0
[ceph.git] / ceph / src / osd / ECTransaction.h
index 346dcd146f3b040cc57197daf7f148c5ffa82cf0..036c8ca8d3d26da60fdbf3868b0aa07d921d7589 100644 (file)
@@ -98,6 +98,7 @@ namespace ECTransaction {
          raw_write_set.insert(extent.get_off(), extent.get_len());
        }
 
+       auto orig_size = projected_size;
        for (auto extent = raw_write_set.begin();
             extent != raw_write_set.end();
             ++extent) {
@@ -109,9 +110,12 @@ namespace ECTransaction {
            head_start = projected_size;
          }
          if (head_start != head_finish &&
-             head_start < projected_size) {
-           assert(head_finish <= projected_size);
+             head_start < orig_size) {
+           assert(head_finish <= orig_size);
            assert(head_finish - head_start == sinfo.get_stripe_width());
+           ldpp_dout(dpp, 20) << __func__ << ": reading partial head stripe "
+                              << head_start << "~" << sinfo.get_stripe_width()
+                              << dendl;
            plan.to_read[i.first].union_insert(
              head_start, sinfo.get_stripe_width());
          }
@@ -124,9 +128,12 @@ namespace ECTransaction {
              extent.get_start() + extent.get_len());
          if (tail_start != tail_finish &&
              (head_start == head_finish || tail_start != head_start) &&
-             tail_start < projected_size) {
-           assert(tail_finish <= projected_size);
+             tail_start < orig_size) {
+           assert(tail_finish <= orig_size);
            assert(tail_finish - tail_start == sinfo.get_stripe_width());
+           ldpp_dout(dpp, 20) << __func__ << ": reading partial tail stripe "
+                              << tail_start << "~" << sinfo.get_stripe_width()
+                              << dendl;
            plan.to_read[i.first].union_insert(
              tail_start, sinfo.get_stripe_width());
          }
@@ -152,7 +159,8 @@ namespace ECTransaction {
          ldpp_dout(dpp, 20) << __func__ << ": truncating out to "
                             <<  truncating_to
                             << dendl;
-         will_write.union_insert(projected_size, truncating_to - projected_size);
+         will_write.union_insert(projected_size,
+                                 truncating_to - projected_size);
          projected_size = truncating_to;
        }