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>
diff --git a/fs_mgr/libfiemap/fiemap_writer.cpp b/fs_mgr/libfiemap/fiemap_writer.cpp
index 06e210e..d61e007 100644
--- a/fs_mgr/libfiemap/fiemap_writer.cpp
+++ b/fs_mgr/libfiemap/fiemap_writer.cpp
@@ -60,6 +60,7 @@
static inline void cleanup(const std::string& file_path, bool created) {
if (created) {
unlink(file_path.c_str());
+ sync();
}
}