We return the minor version number 15 to FUSE_INIT since we don't handle
BATCH_FORGET. Thus the kernel does not accept the latest size of
fuse_init_out. Instead we need to use FUSE_COMPAT_22_INIT_OUT_SIZE.
Previously the code unintentionally used FUSE_COMPAT_22_INIT_OUT_SIZE always
because we override the minor version out->minor to 15. Because sdcard.c shares
the buffer for |in| and |out|, it overrides the version number of in->minnor as
well.
The if closure in the previous code "if (in->minor <= 22)" was always true. The
CL removes the if closure to explicitly use FUSE_COMPAT_22_INIT_OUT_SIZE always.
Bug: 32779923
Test: Manually boot Android and check if the storage shows up in Settings app.
Change-Id: Ibbc50da7fb82be148acfc5f1a3d46fefbe211f9d
- 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
Instead default-initialize to 0. The third field, which is by
default padding, may be renamed and used in some implementations.
Test: m
Change-Id: Iaf0a2b1bf9615f11256c0500fa3ca98b09e34d15
A few changes got dropped along merge resolution. This adds them back
Affected CLs:
Ie188cb044be2ad87166f2d43c32a1f6b97660de0
Ibdb72ad16a1e6c3a01edcb03d003c42de7a03cd6
Change-Id: I1924f5a4bd7564ceaf9bb3a45b7fb7804b3619d7
"PRI{u,x}64" was not compiling on C++ because of macro expansions.
Implement DLOG the same way DCHECK is implemented in
<android-base/logging.h>, and mechanically replace the problematic
lines with C++ logging. Remaining TRACE() lines will be replaced in a
follow-up CL.
Bug: 30222003
Change-Id: I377a91722eb4c035093fc96b79438c4f638b9a45
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
Fix string literals and cast void* appropriately. Alternatively, we
could switch some of the allocations to new/delete, but we would need
to make sure that none of those end up passed to other code that will
call free(3) on them.
Bug: 30110940
Change-Id: I6f39df65cd960930530e5a1f8420a28d50adc25d