}
bufferlist bl;
if (rgw::sal::get_attr(attrs, RGW_POSIX_ATTR_VERSION, bl)) {
- // cur_version.reset();
+ uint16_t flags = 0;
+ ceph::decode(flags, bl);
+ if (flags & rgw_bucket_dir_entry::FLAG_DELETE_MARKER) {
+ ldpp_dout(dpp, 0) << "ERROR: a delete marker, returning ENOENT "
+ << get_name() << dendl;
+ cur_version.reset();
+ return -ENOENT;
+ }
}
}
int VersionedDirectory::add_delete_marker(const DoutPrefixProvider* dpp,
optional_yield y,
std::unique_ptr<File>& marker,
- std::string& name)
+ const std::string &name)
{
// Create as temporary file first
int ret = marker->create(dpp, /*existed=*/nullptr, /*temp_file=*/true);
std::string get_new_instance();
int remove_symlink(const DoutPrefixProvider *dpp, optional_yield y, std::string match = "");
int add_file(const DoutPrefixProvider *dpp, std::unique_ptr<FSEnt>&& file, bool* existed = nullptr, bool temp_file = false);
- int add_delete_marker(const DoutPrefixProvider* dpp, optional_yield y, std::unique_ptr<File>& marker, std::string& name);
+ int add_delete_marker(const DoutPrefixProvider* dpp, optional_yield y, std::unique_ptr<File>& marker, const std::string &name);
FSEnt* get_cur_version_ent() { return cur_version.get(); };
int set_cur_version_ent(const DoutPrefixProvider *dpp, FSEnt* file);
virtual std::unique_ptr<FSEnt> clone_base() override {