summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-08-13 03:09:06 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-13 03:09:06 +0000
commitc4fd7be670c9ed64e699b2f575ce9fbfc7623267 (patch)
tree75fcfe099b2e06475532ca859aa093fad2f7a612
parentdae28203f8c4606b8858577f981945e7b8746cb2 (diff)
parent6c5e453f9ee8363e970c7b5e2be503879089c3c3 (diff)
downloadvold-c4fd7be670c9ed64e699b2f575ce9fbfc7623267.tar.gz
Change-Id: I92e29452f176731c03fc482e5394cc5fad17c9c9
-rw-r--r--secdiscard.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/secdiscard.cpp b/secdiscard.cpp
index 0ff05d6c..4659eedd 100644
--- a/secdiscard.cpp
+++ b/secdiscard.cpp
@@ -147,6 +147,10 @@ bool secdiscard_path(const std::string& path) {
if (!overwrite_with_zeros(fs_fd.get(), range[0], range[1])) return false;
}
}
+ // Should wait for overwrites completion. Otherwise after unlink(),
+ // filesystem can allocate these blocks and IO can be reordered, resulting
+ // in making zero blocks to filesystem blocks.
+ fsync(fs_fd.get());
return true;
}