mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-10 23:00:57 +00:00
Merge pull request #993 from ggtakec/test
Fixed a bug about overwrite metadata at updating directory stats
This commit is contained in:
commit
4db6e1a10a
@ -382,7 +382,7 @@ static int chk_dir_object_type(const char* path, string& newpath, string& nowpat
|
|||||||
(*pType) = DIRTYPE_NOOBJ;
|
(*pType) = DIRTYPE_NOOBJ;
|
||||||
nowpath = "";
|
nowpath = "";
|
||||||
}else{
|
}else{
|
||||||
nowpath = path;
|
nowpath = newpath;
|
||||||
if(0 < nowpath.length() && '/' == nowpath[nowpath.length() - 1]){
|
if(0 < nowpath.length() && '/' == nowpath[nowpath.length() - 1]){
|
||||||
// "dir/" type
|
// "dir/" type
|
||||||
(*pType) = DIRTYPE_NEW;
|
(*pType) = DIRTYPE_NEW;
|
||||||
@ -842,6 +842,10 @@ static int put_headers(const char* path, headers_t& meta, bool is_copy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [NOTE]
|
||||||
|
// if path is 'dir/', it does not have cache(could not open file for directory stat)
|
||||||
|
//
|
||||||
|
if('/' != path[strlen(path) - 1]){
|
||||||
FdEntity* ent = NULL;
|
FdEntity* ent = NULL;
|
||||||
if(NULL == (ent = FdManager::get()->ExistOpen(path, -1, !FdManager::IsCacheDir()))){
|
if(NULL == (ent = FdManager::get()->ExistOpen(path, -1, !FdManager::IsCacheDir()))){
|
||||||
// no opened fd
|
// no opened fd
|
||||||
@ -855,6 +859,7 @@ static int put_headers(const char* path, headers_t& meta, bool is_copy)
|
|||||||
ent->SetMtime(mtime);
|
ent->SetMtime(mtime);
|
||||||
FdManager::get()->Close(ent);
|
FdManager::get()->Close(ent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user