Fixed wrong stat of cache after new creation file

And added a test for stat of cache after new creation file
This commit is contained in:
Takeshi Nakatani
2021-10-16 15:51:36 +00:00
committed by Andrew Gaul
parent 2f412804e2
commit 023aaf7dff
4 changed files with 68 additions and 22 deletions

View File

@ -2173,6 +2173,16 @@ bool FdEntity::PunchHole(off_t start, size_t size)
return true;
}
// [NOTE]
// Indicate that a new file's is dirty.
// This ensures that both metadata and data are synced during flush.
//
void FdEntity::MarkDirtyNewFile()
{
pagelist.Init(0, false, true);
is_meta_pending = true;
}
/*
* Local variables:
* tab-width: 4