History log of /system/core/libappfuse/FuseBuffer.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a6dee5e279de56751238f750d12f8a6237992043 20-Jun-2017 Daichi Hirono <hirono@google.com> Add volatile to temporary variable.

FuseBuffer::HandleNotImpl save the value of |request.header.unique| to the
temporary variable, clear the buffer which is a union of |request| and
|response|, then write back the unique value to response.header.unique.

Before the CL, the temporary variable was wrongly removed by the compiler
optimization, and response.header.unique was always 0. The CL adds
volatile modifier as workaround to prevent the compiler optimization
from removing the temporary value.

Bug: 62429763
Test: libappfuse_tests
Change-Id: Ia853f805633f646f316f585a35c7b018000b6eb3
/system/core/libappfuse/FuseBuffer.cc
e5a1556d402789dc02aa041c8d04d0b23a0ce68e 09-Jun-2017 Daichi Hirono <hirono@google.com> Add more logs for writing failures.

Bug: 62429763
Test: libappfuse_test
Change-Id: Ie0eabd09ae9ad3f8ba8c4f38f871dad16b5c58ff
/system/core/libappfuse/FuseBuffer.cc
bf6e949727d6d86a3e8e3fa5c5f641872134d2a1 17-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change the CHECK failure into function failure." into oc-dev
3df060d6d0e953bacee8e7899d18b404b5a7262f 12-May-2017 Daichi Hirono <hirono@google.com> Change the CHECK failure into function failure.

Previously we have CHECK in WriteInternal function to observe short
writing. However it turns out short write can happen according to the
bug report.

To prevent app from crashing due to CHECK failure, the CL removes the
CHECK and let WriteInternal return a failure value.

Bug: 37561460
Test: libappfuse_tests, manually re-wrote the return value of write()
and checked logcat.
Change-Id: I6a1e233c3ddb8eb68f59e7c606ad0459b5ca2c6e
/system/core/libappfuse/FuseBuffer.cc
287776ddf47ec931880863a64e8d5094cb2b2dfa 28-Apr-2017 Daichi Hirono <hirono@google.com> Use SO_SNDBUFFORCE instead of SO_SNDBUF

When /proc/sys/net/core/wmem_max is smaller than kMaxMessageSize, we
need to override the limitation.

Bug: 37561460
Test: libappfuse_tests

Change-Id: Ibaac8db61290d661459fdc46f0ae8416f7db1d9e
/system/core/libappfuse/FuseBuffer.cc
6f6210dd5c0aae99d67fd945e270a0948e6c4f42 29-Mar-2017 Daichi Hirono <hirono@google.com> Retry write operation when getting ENOBUFS.

Previously libappfuse set SO_SNDBUF to the maximum message size. However
it does not prevent ENOBUF and it made AppFusePerfTest#testReadWriteFile
flaky.

The CL let FuseBuffer retry write operation when getting ENOBUFS.

Bug: 34903085
Test: libappfuse
Change-Id: I1602474d852e1599f6e69103bcf6f18277a5644b
/system/core/libappfuse/FuseBuffer.cc
0bb22bd50ea7264684fa8c35b34fcc380e9d2cdc 22-Mar-2017 Daichi Hirono <hirono@google.com> Add FuseMessage::WriteWithBody function

The funciton is going to be used to write FUSE header with external
body.

Bug: 35229514
Test: libappfuse_tests
Change-Id: I303022b555deca960b8e08f26140a5ef10133efe
/system/core/libappfuse/FuseBuffer.cc
57b780fbc3e2c2442c2f58dcb83818e786246b35 06-Mar-2017 Daichi Hirono <hirono@google.com> Add ReadOrAgain and WriteOrAgain methods to FuseMessage.

These methods return kAgain if operation cannot be done without blocking
the current thread.

The CL also introduecs new helper function SetupMessageSockets so that
FuseMessages are always transfered via sockets that save message
boundaries.

Bug: 34903085
Test: libappfuse_test
Change-Id: I34544372cc1b0c7bc9622e581ae16c018a123fa9
/system/core/libappfuse/FuseBuffer.cc
cb9153bf4324d72c6f1b34a8a1c2f8b9954697d2 08-Dec-2016 Daichi Hirono <hirono@google.com> Support SOCK_STREAM for bridge between system and app

Previously AppFuse use SOCK_SEQPACKET for sockets communicating system
and app. However SOCK_SEQPACKET requires the buffer of message size in
the kernel and sometimes failed to write with ENOBUF.

The CL updates libappfuse so that it can use SOCK_STREAM instead of
SOCK_SEQPACKET.

Bug: 33279206
Test: libappfuse_test
Change-Id: I622ada9ac1d71d0c57b6cfff0904c7829cea7995
/system/core/libappfuse/FuseBuffer.cc
a6373ec1d47c0b370c87b3915feeba8f2b4523f7 05-Dec-2016 Daichi Hirono <hirono@google.com> Fix checks for reading and writing FuseMessage.

Previously FuseMessage were checking result of read/write operation
after checking header.len value is valid. This was wrong because
header.len does not contain correct value when read function does not
read any bytes and returns zero.

Bug: 33278098
Test: libappfuse_test
Change-Id: Icf998ca6c3eeee20cbc4aa2f65195a87e59ffc27
/system/core/libappfuse/FuseBuffer.cc
c884f80755f8ecaed92a783f2a13038ab06ae691 16-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available."
471ad6a59d4ab765a5e93d5dd557057e88858974 10-Nov-2016 Daichi Hirono <hirono@google.com> Use FUSE_COMPAT_22_INIT_OUT_SIZE always if available.

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.

Bug: 32779923
Test: libappfuse_test

Change-Id: I5c979d0e45344ca8adfe3ad3f4a9561442abcb3a
/system/core/libappfuse/FuseBuffer.cc
0d97be4d7db1baa831d0432229dec08c87193919 10-Nov-2016 Daichi Hirono <hirono@google.com> Add static assert to check if FuseBuffer is standard layout union.

Bug: 32260320
Test: libappfuse_test
Change-Id: I6430c11fdeb2405996410c97044b4260c25209b8
/system/core/libappfuse/FuseBuffer.cc
a0aecda12b9a76aa15a8c5175e15538574a05af7 08-Nov-2016 Daichi Hirono <hirono@google.com> Add FuseAppLoop to libappfuse.

The class is used at the app side (StorageManager) to parse FUSE
commands.

Bug: 32260320
Test: libappfuse_test
Change-Id: I1ae2904d3290a041f1efbf8fc10ba032eda5449c
/system/core/libappfuse/FuseBuffer.cc
c6134762975204ceebcf7949e364484833714345 27-Oct-2016 Daichi Hirono <hirono@google.com> Add FuseBridgeLoop to libappfuse.

The CL adds FuseBridgeLoop class to libappfuse, which is used in the
system service to proxy fuse commands to applications.

Bug: 29970149
Test: libappfuse_test
Change-Id: I0708f608b3868721ab16ba4028fd2c17a6735af7
/system/core/libappfuse/FuseBuffer.cc