From: Samuel Just Date: Sat, 27 Aug 2016 18:26:53 +0000 (-0700) Subject: osd_types: allow non-aligned non-overwrites with ECOVERWRITES flag X-Git-Tag: v11.1.0~245^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90f5d3dfcc38e821732ab5659d9767df81e2cd50;p=ceph.git osd_types: allow non-aligned non-overwrites with ECOVERWRITES flag Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4ea736fb3ec..95b40d1a102 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5162,11 +5162,12 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& 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; } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index f6e05b8f86b..dffb6541852 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -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 {