Fix renames of open files with nocopyapi option

References #1296.
This commit is contained in:
Andrew Gaul 2020-05-30 15:45:43 +09:00
parent 75e72385cc
commit 66597ec5f2
2 changed files with 3 additions and 1 deletions

View File

@ -2788,7 +2788,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