From 8538b776cfd9563b5d08511dc0679acec9a13599 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 19 Mar 2026 12:08:31 -0400 Subject: [PATCH] rgw/posix: MPSerializer sets and clears locked status Signed-off-by: Casey Bodley --- src/rgw/driver/posix/rgw_sal_posix.cc | 7 +++++++ src/rgw/driver/posix/rgw_sal_posix.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rgw/driver/posix/rgw_sal_posix.cc b/src/rgw/driver/posix/rgw_sal_posix.cc index eb54567711a..cbf99ef1a30 100644 --- a/src/rgw/driver/posix/rgw_sal_posix.cc +++ b/src/rgw/driver/posix/rgw_sal_posix.cc @@ -3221,12 +3221,19 @@ int MPPOSIXSerializer::try_lock(const DoutPrefixProvider *dpp, ceph::timespan du POSIXBucket* b = static_cast(obj->get_bucket()); if (b->get_dir()->get_type() == ObjectType::MULTIPART && b->get_dir_fd(dpp) > 0) { + locked = true; return 0; } return -ENOENT; } +int MPPOSIXSerializer::unlock(const DoutPrefixProvider *dpp, optional_yield y) +{ + clear_locked(); + return 0; +} + int POSIXObject::transition(Bucket* bucket, const rgw_placement_rule& placement_rule, const real_time& mtime, diff --git a/src/rgw/driver/posix/rgw_sal_posix.h b/src/rgw/driver/posix/rgw_sal_posix.h index 4e6eb0ed255..dd63ea77507 100644 --- a/src/rgw/driver/posix/rgw_sal_posix.h +++ b/src/rgw/driver/posix/rgw_sal_posix.h @@ -1403,7 +1403,7 @@ public: MPPOSIXSerializer(const DoutPrefixProvider *dpp, POSIXDriver* driver, POSIXObject* _obj, const std::string& lock_name) : obj(_obj) {} virtual int try_lock(const DoutPrefixProvider *dpp, ceph::timespan dur, optional_yield y) override; - virtual int unlock(const DoutPrefixProvider* dpp, optional_yield y) override { return 0; } + virtual int unlock(const DoutPrefixProvider* dpp, optional_yield y) override; }; } } // namespace rgw::sal -- 2.47.3