Commit graph

18 commits

Author SHA1 Message Date
Daichi Hirono
9b2c085c47 Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always as the resopnse size of FUSE_INIT." am: 0673412bb9 am: 357876455c am: 5f7ed2dd60
am: 2b73980091

Change-Id: Ibad52be01df7077ce06b86c15c7bb4ad44be1408
2016-11-16 08:17:54 +00:00
Daichi Hirono
357876455c Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always as the resopnse size of FUSE_INIT."
am: 0673412bb9

Change-Id: I85e6be67fdd5285c2abc26a097301c7136a676f9
2016-11-16 07:54:10 +00:00
Daichi Hirono
16d0b426a3 Use FUSE_COMPAT_22_INIT_OUT_SIZE always as the resopnse size of FUSE_INIT.
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
2016-11-16 01:58:28 +00:00
Christopher Ferris
bd615a56ce Merge "Small clean up of fuse code." am: 54c211db2e am: f620b87efe am: c2eaefdd15
am: 5e27cd514f

Change-Id: Ic323724c76b3df1af78d37bc0ced34257c142513
2016-10-10 19:48:20 +00:00
Christopher Ferris
5e27cd514f Merge "Small clean up of fuse code." am: 54c211db2e am: f620b87efe
am: c2eaefdd15

Change-Id: I800d48fb1d74531681cdcd35fcd3ea674e7c3025
2016-10-10 19:42:33 +00:00
Christopher Ferris
d6b0d37549 Small clean up of fuse code.
- 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
2016-10-07 12:16:00 -07:00
Andreas Gampe
f1e65b449e Sdcard: Do not use fuse padding field
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
2016-09-27 08:39:48 -07:00
Thierry Strudel
55cec58703 [DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available am: 738e0dcf0a
am: 5f4db94228

Change-Id: I05fbf1cffb44595d354219b1753cd7c2b37e10db
2016-09-26 21:25:32 +00:00
Daniel Rosenberg
9526819c70 sdcard: Fix bad merge
A few changes got dropped along merge resolution. This adds them back

Affected CLs:
Ie188cb044be2ad87166f2d43c32a1f6b97660de0
Ibdb72ad16a1e6c3a01edcb03d003c42de7a03cd6

Change-Id: I1924f5a4bd7564ceaf9bb3a45b7fb7804b3619d7
2016-08-31 00:04:22 +00:00
Jorge Lucangeli Obes
8df46540b4 Fix one last use of TRACE().
Bug: 30222003
Change-Id: I3d0a29cb92e83416eb6851b54cb72886da4f7cf2
(cherry picked from commit a65f3e1a1f)
2016-07-29 22:02:41 +00:00
Jorge Lucangeli Obes
60b896c438 Merge \"Fix sdcard logging.\"
am: 47b077a44f

Change-Id: Ib0a0b5083d09d60bd0ee42bebcecced05b3645e5
2016-07-27 01:31:20 +00:00
Jorge Lucangeli Obes
e157b253d4 Fix sdcard logging.
Use C++ logging for everything.

Bug: 30222003
Change-Id: I5c5d85102b01df6965a515b59aa275ac85f50f00
2016-07-26 16:52:48 -04:00
Jorge Lucangeli Obes
e629ced86a resolve merge conflicts of c6e22ba to stage-aosp-master
Change-Id: I65550ff841d27f985a3ab8618ecdf4a3500fb0be
2016-07-21 23:14:46 -04:00
Jorge Lucangeli Obes
714ec9d1de sdcard: Fix compilation with FUSE_TRACE == 1.
"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
2016-07-21 17:11:47 -04:00
Jorge Lucangeli Obes
0d039c4c44 Merge \"sdcard: Use std::map.\"
am: c15ab6e2c6

Change-Id: Icacd305ffdf501ce6d7a6bbdd73d5f245575d804
2016-07-20 02:11:47 +00:00
Jorge Lucangeli Obes
d6d8faa690 sdcard: Use std::map.
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
2016-07-19 17:01:15 -04:00
Jorge Lucangeli Obes
da4bc7484f Merge \"Convert fuse.c to C++.\"
am: a17427cb1e

Change-Id: Ie112f67f724e511b6c8ffabd0db04f3e017132cc
2016-07-14 19:47:37 +00:00
Jorge Lucangeli Obes
f08ba05581 Convert fuse.c to C++.
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
2016-07-14 10:03:22 -04:00
Renamed from sdcard/fuse.c (Browse further)