summaryrefslogtreecommitdiffstats
path: root/sdcard
diff options
context:
space:
mode:
authorDaichi Hirono2016-11-09 19:22:42 -0600
committerDaichi Hirono2016-11-15 19:58:28 -0600
commit16d0b426a32f9611278466ee4bb369241f55d74a (patch)
tree40f4afeb73ad93b031dc9c2be64d50a76bdc64ce /sdcard
parentb5ce6f02dd11b42c03884dd9531c6c8a80bcecda (diff)
downloadplatform-system-core-16d0b426a32f9611278466ee4bb369241f55d74a.tar.gz
platform-system-core-16d0b426a32f9611278466ee4bb369241f55d74a.tar.xz
platform-system-core-16d0b426a32f9611278466ee4bb369241f55d74a.zip
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
Diffstat (limited to 'sdcard')
-rw-r--r--sdcard/fuse.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/sdcard/fuse.cpp b/sdcard/fuse.cpp
index d4c51fd74..9393846d3 100644
--- a/sdcard/fuse.cpp
+++ b/sdcard/fuse.cpp
@@ -1262,12 +1262,9 @@ static int handle_init(struct fuse* fuse, struct fuse_handler* handler,
1262#if defined(FUSE_COMPAT_22_INIT_OUT_SIZE) 1262#if defined(FUSE_COMPAT_22_INIT_OUT_SIZE)
1263 /* FUSE_KERNEL_VERSION >= 23. */ 1263 /* FUSE_KERNEL_VERSION >= 23. */
1264 1264
1265 /* If the kernel only works on minor revs older than or equal to 22, 1265 /* Since we return minor version 15, the kernel does not accept the latest
1266 * then use the older structure size since this code only uses the 7.22 1266 * fuse_init_out size. We need to use FUSE_COMPAT_22_INIT_OUT_SIZE always.*/
1267 * version of the structure. */ 1267 fuse_struct_size = FUSE_COMPAT_22_INIT_OUT_SIZE;
1268 if (req->minor <= 22) {
1269 fuse_struct_size = FUSE_COMPAT_22_INIT_OUT_SIZE;
1270 }
1271#endif 1268#endif
1272 1269
1273 out.major = FUSE_KERNEL_VERSION; 1270 out.major = FUSE_KERNEL_VERSION;