From 0a5affe28860721ff8b59463fa6b7e100b6cc430 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Mon, 18 Mar 2024 14:40:50 +0800 Subject: [PATCH] crimson/osd/osd_operations/client_requests: we don't support rados locator keys Fixes: https://tracker.ceph.com/issues/64782 Signed-off-by: Xuehan Xu (cherry picked from commit 44434b22628e10d229fd0ae552a80f2bc8de6307) --- .../osd/osd_operations/client_request.cc | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index e897d552792..2e6b4dcc3fe 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -99,6 +99,23 @@ bool ClientRequest::is_pg_op() const [](auto& op) { return ceph_osd_op_type_pg(op.op.op); }); } +ClientRequest::interruptible_future<> +ClientRequest::reply_op_error(const Ref& pg, int err) +{ + LOG_PREFIX(ClientRequest::reply_op_error); + DEBUGDPP("{}: replying with error {}", *pg, *this, err); + auto reply = crimson::make_message( + m.get(), err, pg->get_osdmap_epoch(), + m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK), + !m->has_flag(CEPH_OSD_FLAG_RETURNVEC)); + reply->set_reply_versions(eversion_t(), 0); + reply->set_op_returns(std::vector{}); + // TODO: gate the crosscore sending + return interruptor::make_interruptible( + get_foreign_connection().send_with_throttling(std::move(reply)) + ); +} + ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptible( Ref pgref, const unsigned this_instance_id, instance_handle_t &ihref) { @@ -109,6 +126,15 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib DEBUGDPP("{} start", *pgref, *this); PG &pg = *pgref; + if (!m->get_hobj().get_key().empty()) { + // There are no users of locator. It was used to ensure that multipart-upload + // parts would end up in the same PG so that they could be clone_range'd into + // the same object via librados, but that's not how multipart upload works + // anymore and we no longer support clone_range via librados. + get_handle().exit(); + co_await reply_op_error(pgref, -ENOTSUP); + co_return; + } if (pg.can_discard_op(*m)) { co_await interruptor::make_interruptible( shard_services->send_incremental_map( @@ -226,23 +252,6 @@ ClientRequest::process_pg_op( get_foreign_connection().send_with_throttling(std::move(reply))); } -ClientRequest::interruptible_future<> -ClientRequest::reply_op_error(const Ref& pg, int err) -{ - LOG_PREFIX(ClientRequest::reply_op_error); - DEBUGDPP("{}: replying with error {}", *pg, *this, err); - auto reply = crimson::make_message( - m.get(), err, pg->get_osdmap_epoch(), - m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK), - !m->has_flag(CEPH_OSD_FLAG_RETURNVEC)); - reply->set_reply_versions(eversion_t(), 0); - reply->set_op_returns(std::vector{}); - // TODO: gate the crosscore sending - return interruptor::make_interruptible( - get_foreign_connection().send_with_throttling(std::move(reply)) - ); -} - ClientRequest::interruptible_future<> ClientRequest::process_op( instance_handle_t &ihref, Ref pg, unsigned this_instance_id) -- 2.39.5