OSDN Git Service

Add mount callback
authorZim <zezeozue@google.com>
Tue, 19 Nov 2019 09:16:03 +0000 (09:16 +0000)
committerMartijn Coenen <maco@google.com>
Fri, 22 Nov 2019 16:06:04 +0000 (17:06 +0100)
commit5048b4b2bc89a888595db79f2f480c8dacf72c43
treeb242d9d5a571150bad1e5c02f93d0bca1f1d1dfb
parent2d45d9b42063d57f8be769555fc9c47eabe74f9a
Add mount callback

Mounting a FUSE path needs two steps:
1. Mounting the filesystem
2. Starting the FUSE session in the FUSE daemon

The second part requires retriving an fd from (1) and the mount paths
and passing it to the FUSE daemon.

Previously, we'd return from the Vold mount call and mark the volume
as mounted while we scramble to do (2). This means there's a time
period where the Volume is marked as MOUNTED but not actually ready
and any IO access on the paths will hang forever. This could also be
misleading when interpreting bug reports.

Now, we block the Vold mount call until the FUSE session is started

Test: atest AdoptableHostTest
Bug: 144275217

Change-Id: I45238a31df71286f67ef1c65c711d0085d72e97f
Android.bp
VoldNativeService.cpp
VoldNativeService.h
binder/android/os/IVold.aidl
binder/android/os/IVoldMountCallback.aidl [new file with mode: 0644]
model/EmulatedVolume.cpp
model/PublicVolume.cpp
model/VolumeBase.cpp
model/VolumeBase.h