mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-23 01:08:54 +00:00
Improved updating of temporary stat cache while creating a file
This commit is contained in:
parent
7b5111c955
commit
34c379babb
15
src/s3fs.cpp
15
src/s3fs.cpp
@ -2567,6 +2567,21 @@ static int s3fs_utimens(const char* _path, const struct timespec ts[2])
|
|||||||
// If there is data in the Stats cache, update the Stats cache.
|
// If there is data in the Stats cache, update the Stats cache.
|
||||||
StatCache::getStatCacheData()->UpdateMetaStats(strpath, updatemeta);
|
StatCache::getStatCacheData()->UpdateMetaStats(strpath, updatemeta);
|
||||||
|
|
||||||
|
// [NOTE]
|
||||||
|
// There are cases where this function is called during the process of
|
||||||
|
// creating a new file (before uploading).
|
||||||
|
// In this case, a temporary cache exists in the Stat cache.(see s3fs_create)
|
||||||
|
// So we need to update the cache, if it exists.
|
||||||
|
//
|
||||||
|
// Previously, the process of creating a new file was to update the
|
||||||
|
// file content after first uploading the file, but now the file is
|
||||||
|
// not created until flushing.
|
||||||
|
// So we need to create a temporary Stat cache for it.
|
||||||
|
//
|
||||||
|
if(!StatCache::getStatCacheData()->AddStat(strpath, updatemeta, false, true)){
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
S3FS_PRN_INFO("meta is not pending, but need to keep current mtime.");
|
S3FS_PRN_INFO("meta is not pending, but need to keep current mtime.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user