Merge pull request #1302 from gaul/rename/nocopy

Fix renames of open files with nocopyapi option
This commit is contained in:
Takeshi Nakatani 2020-05-31 23:46:46 +09:00 committed by GitHub
commit 0f5db0d1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -2805,7 +2805,7 @@ void FdManager::Rename(const std::string &from, const std::string &to)
// rename path and caches in fd entity
string fentmapkey;
if(!ent->RenamePath(to, fentmapkey)){
S3FS_PRN_ERR("Failed to rename FdEntity obejct for %s to %s", from.c_str(), to.c_str());
S3FS_PRN_ERR("Failed to rename FdEntity object for %s to %s", from.c_str(), to.c_str());
return;
}

View File

@ -1373,6 +1373,8 @@ static int rename_object_nocopy(const char* from, const char* to)
FdManager::get()->Close(ent);
return result;
}
FdManager::get()->Rename(from, to);
FdManager::get()->Close(ent);
// Remove file