Always flush open files with O_CREAT flag (#1879)

Previously s3fs only created files that had dirty data and not those
with zero-bytes.  Regression from
771bbfeac5.  References #1013.  Found
via pjdfstest.  References #1589.
This commit is contained in:
Andrew Gaul 2022-01-30 22:02:37 +09:00 committed by GitHub
parent 0c75a63184
commit f6ed972926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1343,7 +1343,7 @@ int FdEntity::RowFlush(int fd, const char* tpath, bool force_sync)
if(pseudo_fd_map.end() == miter || NULL == miter->second){
return -EBADF;
}
if(!miter->second->Writable()){
if(!miter->second->Writable() && !(miter->second->GetFlags() & O_CREAT)){
// If the entity is opened read-only, it will end normally without updating.
return 0;
}