]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: allow non-aligned non-overwrites with ECOVERWRITES flag
authorSamuel Just <sjust@redhat.com>
Sat, 27 Aug 2016 18:26:53 +0000 (11:26 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Nov 2016 18:40:18 +0000 (10:40 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc
src/osd/osd_types.h

index 4ea736fb3ec38ef128b75749d0f0a443b32cb344..95b40d1a1025e9eb222da44d15c97cd787541b55 100644 (file)
@@ -5162,11 +5162,12 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        }
 
        if (!obs.exists) {
-         if (pool.info.require_rollback() && op.extent.offset) {
+         if (pool.info.requires_aligned_append() && op.extent.offset) {
            result = -EOPNOTSUPP;
            break;
          }
-       } else if (op.extent.offset != oi.size && pool.info.require_rollback()) {
+       } else if (op.extent.offset != oi.size &&
+                  pool.info.requires_aligned_append()) {
          result = -EOPNOTSUPP;
          break;
        }
index f6e05b8f86ba25b2011e7ec0c95248ee94942009..dffb65418520ad09096320af4c730f143fbdaa50 100644 (file)
@@ -1401,7 +1401,9 @@ public:
     return !(get_type() == TYPE_ERASURE);
   }
 
-  bool requires_aligned_append() const { return is_erasure(); }
+  bool requires_aligned_append() const {
+    return is_erasure() && !has_flag(FLAG_EC_OVERWRITES);
+  }
   uint64_t required_alignment() const { return stripe_width; }
 
   bool can_shift_osds() const {