]> review.fuel-infra Code Review - packages/trusty/ceph.git/commitdiff
Fix possible rbd data corruption 39/27739/6
authorAlexey Sheplyakov <asheplyakov@mirantis.com>
Mon, 24 Oct 2016 07:27:59 +0000 (10:27 +0300)
committerAlexey Stupnikov <astupnikov@mirantis.com>
Thu, 23 Mar 2017 08:29:28 +0000 (08:29 +0000)
Fixes http://tracker.ceph.com/issues/17545

Closes-bug: #1627775
Change-Id: Ia016914438da8ff649c86e0d1c46de728fa23707

debian/changelog
debian/patches/ObjectCacher-fix-bh_read_finish-offset-logic.patch [new file with mode: 0644]
debian/patches/series

index 93eb363dd4fe8f2941c1dce9dfbb0810e6b58bf4..0ccbc4f1751b36d73e1b4f59d4823f0ef31b906a 100644 (file)
@@ -1,3 +1,10 @@
+ceph (0.94.5-0u~u14.04+mos3+mos8.0+3) mos8.0; urgency=medium
+
+  * Fix possible rbd data corruption, http://tracker.ceph.com/issues/17545
+    While at it clarify the origin of already applied patches.
+
+ -- Alexey Sheplyakov <asheplyakov@mirantis.com>  Mon, 24 Oct 2016 10:24:49 +0300
+
 ceph (0.94.5-0u~u14.04+mos3+mos8.0+2) mos8.0; urgency=medium
 
   * Added configs for logrotate to ceph and radosgw packages
diff --git a/debian/patches/ObjectCacher-fix-bh_read_finish-offset-logic.patch b/debian/patches/ObjectCacher-fix-bh_read_finish-offset-logic.patch
new file mode 100644 (file)
index 0000000..6945c39
--- /dev/null
@@ -0,0 +1,39 @@
+From: Greg Farnum <gfarnum@redhat.com>
+Date: Mon, 23 May 2016 15:14:21 -0700
+Subject: ObjectCacher: fix bh_read_finish offset logic
+
+If we have an incoming read split across multiple BufferHeads, we want to
+line up the BufferHead's bl with the incoming OSDOp's bl at the right offset. We
+were erroneously using this nonsense calculation (always equal to zero!) when
+a much simpler comparison of the BufferHead's logical object offset to the
+incoming OSDOp's logical offset will do the trick nicely.
+
+Fixes: http://tracker.ceph.com/issues/16002
+
+Signed-off-by: Greg Farnum <gfarnum@redhat.com>
+(cherry picked from commit 9ec6e7f608608088d51e449c9d375844631dcdde)
+---
+ src/osdc/ObjectCacher.cc | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc
+index b2c2572..cad168c 100644
+--- a/src/osdc/ObjectCacher.cc
++++ b/src/osdc/ObjectCacher.cc
+@@ -787,7 +787,6 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid,
+       if (bh->error < 0)
+       err = bh->error;
+-      loff_t oldpos = opos;
+       opos = bh->end();
+       if (r == -ENOENT) {
+@@ -807,7 +806,7 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid,
+       mark_error(bh);
+       } else {
+       bh->bl.substr_of(bl,
+-                       oldpos-bh->start(),
++                       bh->start() - start,
+                        bh->length());
+       mark_clean(bh);
+       }
index 73e5ab28a8a340ee2283c17a961dae20d4999ca3..c3ba227a599732793417e5e30a3e31cec0fdfdaa 100644 (file)
@@ -1,5 +1,7 @@
 ## Backported / Upstream
 sleep-recover.patch
+
+## Mirantis
 Compare-parted-output-with-the-dereferenced-path.patch
 ceph-disk-is_mpath-predicate-for-multipath-devices.patch
 ceph-disk-multipath-support-for-is_partition-and-lis.patch
@@ -16,4 +18,7 @@ ceph-osd-prestart-path.patch
 fix-argparse-defaults.patch
 fix-cycles-arch.patch
 vivid-does-systemd.patch
+
+## Mirantis
 PG-activate-handle-unexpected-cached_removed_snaps-m.patch
+ObjectCacher-fix-bh_read_finish-offset-logic.patch