OSDN Git Service

Avoid killing the FUSE daemon during unmount
authorZim <zezeozue@google.com>
Thu, 4 Mar 2021 12:21:24 +0000 (12:21 +0000)
committerZimuzo Ezeozue <zezeozue@google.com>
Fri, 5 Mar 2021 11:05:16 +0000 (11:05 +0000)
commit75273001a212d1e437434fe30efc72ba582f89c6
tree94a429c3295945388a67516086c8b59547bd9c8d
parent2d0ea905388c7bbb8382d768c58cacbf4ef6dd01
Avoid killing the FUSE daemon during unmount

The FUSE daemon is often holding fds on behalf of other apps and if a
volume is ejected the daemon would often get killed first while vold
is walking /proc/<pid>/fd to kill pids with open fds on the
volume. This is required for the volume unmount successfully.

To mitigate this, we avoid killing the FUSE daemon during the usual
/proc walk. This ensures that we first send SIGINT, SIGTERM and
SIGKILL to other apps first. There is an additional SIGKILL attempt
and on that last attempt, we kill the FUSE daemon as a last resort

Test: Manual
Bug: 171673908
Change-Id: I100d2ce4cb4c145cbb49e0696842e97dfba2c1c9
Process.cpp
Process.h
Utils.cpp