]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't assert on zero-length OP_ZERO request
authorJeff Layton <jlayton@redhat.com>
Tue, 13 Jul 2021 13:50:50 +0000 (09:50 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 27 Jul 2021 19:29:31 +0000 (15:29 -0400)
I was able to crash the OSD by sending it a CEPH_OSD_OP_ZERO request
that had an op.extent.length that was 0. Convert that to a no-op
instead.

Fixes: https://tracker.ceph.com/issues/51644
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/osd/PrimaryLogPG.cc

index ac631a7f1f5600c8143db58914b4ee37c843cb2c..64e596b107acb47870bac029a4c439c4cfc17059 100644 (file)
@@ -6811,8 +6811,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        if (result < 0)
          break;
 
-       ceph_assert(op.extent.length);
-       if (obs.exists && !oi.is_whiteout()) {
+       if (op.extent.length && obs.exists && !oi.is_whiteout()) {
          t->zero(soid, op.extent.offset, op.extent.length);
          interval_set<uint64_t> ch;
          ch.insert(op.extent.offset, op.extent.length);