This will cause devices to default to sdcardfs if the kernel
supports it.
Test: Booted a wiped device, ensured sdcardfs was enabled
Change-Id: Ibce012b841b78d37ade668a38e91dca74a637867
Sdcardfs has been modified to use bind mounts
in place of three separate mounts. This lowers
resource usage, and removes a number of race
conditions around updates via differnt views.
Test: Run storage cts tests with sdcardfs enabled
Change-Id: Icdc196ba3d6f46d54d27ef91c01ffebcf81dd47e
- Add TEMP_FAILURE_RETRY around all relevant system calls.
- Cleanup some of the read calls.
- Add error log messages when read/write calls do not actually read/write the
expected number of bytes.
- Add error messages for write failures in fuse_status/fuse_replay.
Test: Attached to the sdcard process and stepped through most of the modified
Test: code. Also, create/read/write/delete files in /storage/emulated/0
Test: directory.
Change-Id: I73e4c0db861960f4c0af1bf96b06cd61fa74be69
A few changes got dropped along merge resolution. This adds them back
Affected CLs:
Ie188cb044be2ad87166f2d43c32a1f6b97660de0
Ibdb72ad16a1e6c3a01edcb03d003c42de7a03cd6
Change-Id: I1924f5a4bd7564ceaf9bb3a45b7fb7804b3619d7
Having CaseInsensitiveCompare use strcasecomp is not ideal, but other
solutions are not prettier.
Also, add a TODO to fix FUSE_TRACE, broken by the switch to C++.
Bug: 27147273
Change-Id: I0017c3a7d0254eb81abd128b97cd06c5ad0d1dff
Having so many copies of privilege-dropping code leads to errors.
De-duplicate this code and use Minijail for it.
Bug: 30156807
Change-Id: I36c85962b913a12efe5648a23cbacc5bcbb3853c
This gets rid of a bunch of "strerror(errno)" bits.
Will convert fuse.cpp after
https://android-review.googlesource.com/#/c/247780 lands.
Bug: 30110940
Change-Id: Iacefe5b6519b217ed687c709763fe5827b3b0b59
sdcard.c is a *really* big file. This makes it hard to do things like
improving priv dropping or adding more sandboxing. Extract all
FUSE-related code to a separate unit, fuse.{h|c}, which exports only
two functions. Convert the rest of sdcard.c to C++ as sdcard.cpp.
fuse.c is kept as C (at least for now) since interacting with the FUSE
API is realistically easier from C.
Bug: 30110940
Change-Id: I188bfdc21c184742117e07539adb09090d4d747c