diff options
author | Josh Gao <jmgao@google.com> | 2021-02-01 16:48:25 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2021-02-01 17:48:58 -0800 |
commit | 88846a2ccfdbe36bcb04fa3f4a5b735403e8a1b6 (patch) | |
tree | 8c7a8ea74eddf1540db67251242428755ab725ce /libutils/Unicode.cpp | |
parent | b44cf2d71b76060e7cb78593699e1139df2d8fa2 (diff) |
Let system_server truncate tombstones.
There's no way to atomically unlink a specific file for which we have an fd from
a path, which means that we can't safely delete a tombstone without coordination
with tombstoned, which is risky. For example, if we use flock on the directory,
and system_server crashes while holding the lock, we risk deadlock.
We do the next best thing, and keep a file descriptor around for every
tombstone, and truncate it, which requires system_server to be able to
write to tombstones (which are owned by the system group).
Test: treehugger
Change-Id: I6ba7f1fe87ee1a4b57bdb3741e8ec9fbc80788c9
Diffstat (limited to 'libutils/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions