Remove unneeded volatile qualifiers (#1702)

We should use proper locking instead.  Specifically for
is_meta_pending this does not do what was intended due to the
read-modify-write of the member.
This commit is contained in:
Andrew Gaul
2021-06-30 08:20:44 +09:00
committed by GitHub
parent f505c8224e
commit 2f59cb5a0a
3 changed files with 4 additions and 3 deletions

View File

@ -1755,11 +1755,12 @@ int put_headers(const char* path, headers_t& meta, bool is_copy, bool use_st_siz
int FdEntity::UploadPendingMeta()
{
AutoLock auto_lock(&fdent_lock);
if(!is_meta_pending) {
return 0;
}
AutoLock auto_lock(&fdent_lock);
headers_t updatemeta = orgmeta;
updatemeta["x-amz-copy-source"] = urlEncode(service_path + bucket + get_realpath(path.c_str()));
// put headers, no need to update mtime to avoid dead lock