Call sync() to guarantee blocks were released by unlink

Otherwise, the cached inode does not release the blocks which causes next
allocation for pinning fails.

Bug: 349270107
Change-Id: I4c2886683ea1949c1999e551a80b56dc37459dba
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
This commit is contained in:
Jaegeuk Kim 2024-06-27 10:27:21 -07:00
parent b2bd7ae863
commit a7b4a9d4f9

View file

@ -60,6 +60,7 @@ static_assert(sizeof(off_t) == sizeof(uint64_t));
static inline void cleanup(const std::string& file_path, bool created) {
if (created) {
unlink(file_path.c_str());
sync();
}
}