From 90f5d3dfcc38e821732ab5659d9767df81e2cd50 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sat, 27 Aug 2016 11:26:53 -0700 Subject: [PATCH] osd_types: allow non-aligned non-overwrites with ECOVERWRITES flag Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 5 +++-- src/osd/osd_types.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 { -- 2.39.5