mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-16 17:25:13 +00:00
Fixed bugs(Issue 363)
1) Fixed Issue 363 Fixed a bug which has below reason. Fuse does not wait finishing "release file descriptor" function called by fuse, and fuse runs(calls) next processing(commands). Then s3fs could not clear stats cache information for that file before calling next processing, and s3fs uses old stats cache information. So that, s3fs clears stats cache in release function at first. And found two bad codes(but these codes do not influence normal movement) in fdcache.cpp and fixed these. Issue 363: make check failing inconsistently git-svn-id: http://s3fs.googlecode.com/svn/trunk@471 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
07a8caa250
commit
b3682f87d2
@ -515,7 +515,7 @@ void FdEntity::Clear(void)
|
|||||||
AutoLock auto_lock(&fdent_lock);
|
AutoLock auto_lock(&fdent_lock);
|
||||||
|
|
||||||
if(file){
|
if(file){
|
||||||
{
|
if(0 != cachepath.size()){
|
||||||
CacheFileStat cfstat(path.c_str());
|
CacheFileStat cfstat(path.c_str());
|
||||||
if(!pagelist.Serialize(cfstat, true)){
|
if(!pagelist.Serialize(cfstat, true)){
|
||||||
DPRN("failed to save cache stat file(%s).", path.c_str());
|
DPRN("failed to save cache stat file(%s).", path.c_str());
|
||||||
@ -543,7 +543,7 @@ void FdEntity::Close(void)
|
|||||||
refcnt--;
|
refcnt--;
|
||||||
}
|
}
|
||||||
if(0 == refcnt){
|
if(0 == refcnt){
|
||||||
{
|
if(0 != cachepath.size()){
|
||||||
CacheFileStat cfstat(path.c_str());
|
CacheFileStat cfstat(path.c_str());
|
||||||
if(!pagelist.Serialize(cfstat, true)){
|
if(!pagelist.Serialize(cfstat, true)){
|
||||||
DPRN("failed to save cache stat file(%s).", path.c_str());
|
DPRN("failed to save cache stat file(%s).", path.c_str());
|
||||||
|
14
src/s3fs.cpp
14
src/s3fs.cpp
@ -1960,6 +1960,16 @@ static int s3fs_release(const char* path, struct fuse_file_info* fi)
|
|||||||
{
|
{
|
||||||
FPRN("[path=%s][fd=%llu]", path, (unsigned long long)(fi->fh));
|
FPRN("[path=%s][fd=%llu]", path, (unsigned long long)(fi->fh));
|
||||||
|
|
||||||
|
// [NOTICE]
|
||||||
|
// At first, we remove stats cache.
|
||||||
|
// Because fuse does not wait for responce from "release" function. :-(
|
||||||
|
// And fuse runs next command before this function returns.
|
||||||
|
// Thus we call deleting stats function ASSAP.
|
||||||
|
//
|
||||||
|
if((fi->flags & O_RDWR) || (fi->flags & O_WRONLY)){
|
||||||
|
StatCache::getStatCacheData()->DelStat(path);
|
||||||
|
}
|
||||||
|
|
||||||
FdEntity* ent;
|
FdEntity* ent;
|
||||||
if(NULL == (ent = FdManager::get()->GetFdEntity(path))){
|
if(NULL == (ent = FdManager::get()->GetFdEntity(path))){
|
||||||
DPRN("could not find fd(file=%s)", path);
|
DPRN("could not find fd(file=%s)", path);
|
||||||
@ -1976,10 +1986,6 @@ static int s3fs_release(const char* path, struct fuse_file_info* fi)
|
|||||||
DPRNNN("Warning - file(%s),fd(%d) is still opened.", path, ent->GetFd());
|
DPRNNN("Warning - file(%s),fd(%d) is still opened.", path, ent->GetFd());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((fi->flags & O_RDWR) || (fi->flags & O_WRONLY)){
|
|
||||||
StatCache::getStatCacheData()->DelStat(path);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user