]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: Return ct_error::object_corrupted when getting an EIO from disk or due...
authorAmnon Hanuhov <ahanukov@redhat.com>
Thu, 26 Nov 2020 15:32:46 +0000 (10:32 -0500)
committerAmnon Hanuhov <ahanukov@redhat.com>
Thu, 14 Jan 2021 13:31:50 +0000 (15:31 +0200)
Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/osd/pg_backend.cc

index 4ba0a403ed1cfb1e17a815f9a426fe9759412830..7fa2f2e5e4986929c540d97a142138c43c3d7d1f 100644 (file)
@@ -209,13 +209,17 @@ PGBackend::read(const ObjectState& os, OSDOp& osd_op)
   return _read(oi.soid, offset, length, op.flags).safe_then(
     [&oi, &osd_op](auto&& bl) -> read_errorator::future<> {
     if (!_read_verify_data(oi, bl)) {
+      // crc mismatches
       return crimson::ct_error::object_corrupted::make();
     }
     logger().debug("read: data length: {}", bl.length());
     osd_op.rval = bl.length();
     osd_op.outdata = std::move(bl);
     return read_errorator::now();
-  });
+  }, crimson::ct_error::input_output_error::handle([] {
+    return read_errorator::future<>{crimson::ct_error::object_corrupted::make()};
+  }),
+  read_errorator::pass_further{});
 }
 
 PGBackend::read_errorator::future<>
@@ -241,10 +245,13 @@ PGBackend::sparse_read(const ObjectState& os, OSDOp& osd_op)
                          osd_op.op.extent.length, os.oi.soid);
           return read_errorator::make_ready_future<>();
         } else {
-          // TODO: repair it if crc mismatches
+          // crc mismatches
           return crimson::ct_error::object_corrupted::make();
         }
-      });
+      }, crimson::ct_error::input_output_error::handle([] {
+        return read_errorator::future<>{crimson::ct_error::object_corrupted::make()};
+      }),
+      read_errorator::pass_further{});
     });
   });
 }