113 Commits

Author SHA1 Message Date
Tashfin Shakeer Rhythm
1668b4c520 incfs: Use ARM64 v8 ASM to accelerate lz4 decompression
Change-Id: Ied66bf0037e6669870667acdf55866bc61245508
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-08-18 03:56:56 -03:00
Paul Lawrence
84c10b8e20 ANDROID: incremental fs: Evict inodes before freeing mount data
Since evicting inodes triggers writes to the backing file, which uses
the mi_owner field from the mount_info struct, make sure inodes are
evicted before we free the mount_info data

Test: incfs_test
Bug: 270117845
Change-Id: I673b2e0e04b5adc3998caf6f22443598a30338af
Signed-off-by: Paul Lawrence <paullawrence@google.com>
(cherry picked from commit 7899985277527b29c47929a6d6a89c5c89b406ad)
(cherry picked from commit faf3626b8e34df3dfff3a99e6582a9abd24410ce)
Signed-off-by: Lee Jones <joneslee@google.com>
2023-05-05 06:16:51 +00:00
Tadeusz Struk
6e240531fb ANDROID: incremental-fs: limit mount stack depth
Syzbot recently found a number of issues related to incremental-fs
(see bug numbers below). All have to do with the fact that incr-fs
allows mounts of the same source and target multiple times.
This is a design decision and the user space component "Data Loader"
expects this to work for app re-install use case.
The mounting depth needs to be controlled, however, and only allowed
to be two levels deep. In case of more than two mount attempts the
driver needs to return an error.
In case of the issues listed below the common pattern is that the
reproducer calls:

mount("./file0", "./file0", "incremental-fs", 0, NULL)

many times and then invokes a file operation like chmod, setxattr,
or open on the ./file0. This causes a recursive call for all the
mounted instances, which eventually causes a stack overflow and
a kernel crash:

BUG: stack guard page was hit at ffffc90000c0fff8
kernel stack overflow (double-fault): 0000 [#1] PREEMPT SMP KASAN

This change also cleans up the mount error path to properly clean
allocated resources and call deactivate_locked_super(), which
causes the incfs_kill_sb() to be called, where the sb is freed.

Bug: 211066171
Bug: 213140206
Bug: 213215835
Bug: 211914587
Bug: 211213635
Bug: 213137376
Bug: 211161296

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: I08d9b545a2715423296bf4beb67bdbbed78d1be1
2022-04-08 13:03:06 -07:00
Tadeusz Struk
cb5d0103b1 Revert "ANDROID: incremental-fs: fix mount_fs issue"
This reverts commit 4ab5bac1598e3ed91a6267f6cada336467312112 and
2da7ed1f781983a2bc818f1d6f7cc9f2fa3ff1d2.

This is to fix the incrementalinstall test.
Can now install the same apk twice, and repeated installs are stable.

Bug: 217661925
Bug: 219731048

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: I77f038b296041b329060ff9350e4c9711f5ed91d
2022-03-08 18:51:11 -08:00
Tadeusz Struk
2da7ed1f78 ANDROID: incremental-fs: remove index and incomplete dir on umount
Cleanup incremental-fs left overs on umount, otherwise incr-fs will
complain as below:

BUG: Dentry {i=47a,n=.incomplete} still in use [unmount of incremental-fs]

This requires vfs_rmdir() of the special index dir.
Since set_anon_super() was used in incfs_mount_fs() the incfs_kill_sb()
should use kill_anon_super() instead of generic_shutdown_super()
otherwise it will leak the pseudo dev_t that set_anon_super() allocates.

Bug: 211066171

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: I7ea54db63513fc130e1997cbf79121015ee12405
2022-02-02 10:57:15 -08:00
Tadeusz Struk
4ab5bac159 ANDROID: incremental-fs: fix mount_fs issue
Syzbot recently found a number of issues related to incremental-fs
(see bug numbers below). All have to do with the fact that incr-fs
allows mounts of the same source and target multiple times.
The correct behavior for a file system is to allow only one such
mount, and then every subsequent attempt should fail with a -EBUSY
error code. In case of the issues listed below the common pattern
is that the reproducer calls:

mount("./file0", "./file0", "incremental-fs", 0, NULL)

many times and then invokes a file operation like chmod, setxattr,
or open on the ./file0. This causes a recursive call for all the
mounted instances, which eventually causes a stack overflow and
a kernel crash:

BUG: stack guard page was hit at ffffc90000c0fff8
kernel stack overflow (double-fault): 0000 [#1] PREEMPT SMP KASAN

The reason why many mounts with the same source and target are
possible is because the incfs_mount_fs() as it is allocates a new
super_block for every call, regardless of whether a given mount already
exists or not. This happens every time the sget() function is called
with a test param equal to NULL.
The correct behavior for an FS mount implementation is to call
appropriate mount vfs call for it's type, i.e. mount_bdev() for
a block device backed FS, mount_single() for a pseudo file system,
like sysfs that is mounted in a single, well know location, or
mount_nodev() for other special purpose FS like overlayfs.
In case of incremental-fs the open coded mount logic doesn't check
for abusive mount attempts such as overlays.
To fix this issue the logic needs to be changed to pass a proper
test function to sget() call, which then checks if a super_block
for a mount instance has already been allocated and also allows
the VFS to properly verify invalid mount attempts.

Bug: 211066171
Bug: 213140206
Bug: 213215835
Bug: 211914587
Bug: 211213635
Bug: 213137376
Bug: 211161296

Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Change-Id: I66cfc3f1b5aaffb32b0845b2dad3ff26fe952e27
2022-01-24 10:31:08 -08:00
Lee Jones
628e070277 ANDROID: Incremental fs: Fix dentry get/put imbalance on vfs_mkdir() failure
Syz{bot,kaller} reports[0]:

  BUG: Dentry ffff888119d8a000{i=0,n=.index}  still in use (1) [unmount of ramfs ramfs]
  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 367 at fs/dcache.c:1616 umount_check+0x18d/0x1d0 fs/dcache.c:1607
  Modules linked in:
  CPU: 0 PID: 367 Comm: syz-executor388 Not tainted 5.10.75-syzkaller-01082-g234d53d2bb60 #0
  Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
  RIP: 0010:umount_check+0x18d/0x1d0 fs/dcache.c:1607
  Code: 8b 0b 49 81 c6 f8 03 00 00 48 c7 c7 00 40 2e 85 4c 89 e6 48 8b 55 d0 4c 89 e1 45 89 f8 31 c0 41 56 e8 ae d9 9e ff 48 83 c4 08 <0f> 0b e9 f1 fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c c9 fe ff
  RSP: 0018:ffffc9000096f770 EFLAGS: 00010292
  RAX: 0000000000000055 RBX: ffffffff866af200 RCX: 1ad6b89836e5b500
  RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
  RBP: ffffc9000096f7a0 R08: ffffffff81545368 R09: 0000000000000003
  R10: fffff5200012de41 R11: 0000000000000004 R12: ffff888119d8a000
  R13: dffffc0000000000 R14: ffff88811d7373f8 R15: 0000000000000001
  FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f01b7bddb68 CR3: 000000010c4f0000 CR4: 00000000003506b0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   d_walk+0x309/0x540 fs/dcache.c:1326
   do_one_tree fs/dcache.c:1623 [inline]
   shrink_dcache_for_umount+0x8e/0x1b0 fs/dcache.c:1639
   generic_shutdown_super+0x66/0x2c0 fs/super.c:447
   kill_anon_super fs/super.c:1108 [inline]
   kill_litter_super+0x75/0xa0 fs/super.c:1117
   ramfs_kill_sb+0x44/0x50 fs/ramfs/inode.c:270
   deactivate_locked_super+0xb0/0x100 fs/super.c:335
   deactivate_super+0xa5/0xd0 fs/super.c:366
   cleanup_mnt+0x45f/0x510 fs/namespace.c:1118
   __cleanup_mnt+0x19/0x20 fs/namespace.c:1125
   task_work_run+0x147/0x1b0 kernel/task_work.c:154
   exit_task_work include/linux/task_work.h:30 [inline]
   do_exit+0x70e/0x23a0 kernel/exit.c:813
   do_group_exit+0x16a/0x2d0 kernel/exit.c:910
   get_signal+0x133e/0x1f80 kernel/signal.c:2790
   arch_do_signal+0x8d/0x620 arch/x86/kernel/signal.c:805
   exit_to_user_mode_loop kernel/entry/common.c:161 [inline]
   exit_to_user_mode_prepare+0xaa/0xe0 kernel/entry/common.c:191
   syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266
   do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56
   entry_SYSCALL_64_after_hwframe+0x44/0xa9
  RIP: 0033:0x7f01b7b884f9
  Code: Unable to access opcode bytes at RIP 0x7f01b7b884cf.
  RSP: 002b:00007f01b7b19308 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
  RAX: fffffffffffffe00 RBX: 00007f01b7c103f8 RCX: 00007f

Which was due to a missing dput() before returning from a vfs_mkdir() failure.

Bug: 203827798
Link: [0] https://syzkaller.appspot.com/bug?extid=81b5ca9b2848f4dad8fa
Reported-by: syzbot+81b5ca9b2848f4dad8fa@syzkaller.appspotmail.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: Iaef9aa0aecc964645aaca5fe8d79388ae28527bd
2021-10-28 08:41:27 +00:00
Paul Lawrence
793953356b ANDROID: Incremental fs: Set credentials before reading/writing
Use same selinux scheme as incfs v2
Fix memory leak

Bug: 174692664
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I6058ddad9d43ba01b2eabd7d3c576f2cc9b42292
2021-04-12 14:48:25 +00:00
Paul Lawrence
432643f1c9 Revert "ANDROID: Incremental fs: RCU locks instead of mutex for pending_reads."
This reverts commit 0201fbedeb871293b5109786f4de6c3fe01746d6.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ic2e3a91943f67601fff3c2b8696cc11bb7069b04
2021-01-27 08:19:09 -08:00
Paul Lawrence
e17a9ed44c Revert "ANDROID: Incremental fs: Fix minor bugs"
This reverts commit d124911d0832c9d4a42979ad4f68eebe100db30a.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ifa9b4afee5b143879d734576764967ffb7a15e77
2021-01-27 08:19:08 -08:00
Paul Lawrence
494f5f87f1 Revert "ANDROID: Incremental fs: dentry_revalidate should not return -EBADF."
This reverts commit 9540a2c0de66fc55825601db8b3101a087840cca.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I6b9c5fa2f21c718ab1330e441ab66b17c1907225
2021-01-27 08:19:08 -08:00
Paul Lawrence
4c63389532 Revert "ANDROID: Incremental fs: Remove annoying pr_debugs"
This reverts commit e7ee942c0366c9e4657465c760f532c300061d20.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I78092cc580b196da60c1a194e3fc94037d0c91d9
2021-01-27 08:19:07 -08:00
Paul Lawrence
8d65e3209e Revert "ANDROID: Incremental fs: Remove unnecessary dependencies"
This reverts commit 21885f49ae23b37ee05a73da7f36177700595ee7.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I70c212c3b9d3a77429714e12f5020f7bded4a6bc
2021-01-27 08:19:07 -08:00
Paul Lawrence
f5e29dfb1c Revert "ANDROID: Incremental fs: Use R/W locks to read/write segment blockmap."
This reverts commit 3d538dbc4ce562e0467974cd64ebe4fee3eced8a.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I22f538f270e379da9abf56508f19d69c54c1c5c2
2021-01-27 08:19:06 -08:00
Paul Lawrence
a16a6c43a9 Revert "ANDROID: Incremental fs: Fix incfs to work on virtio-9p"
This reverts commit d78af37eedd05b8f3df7eaa894c0e8596f0cc8a5.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib50924896007f6983728b354a540b5a02fa34d0f
2021-01-27 08:19:04 -08:00
Paul Lawrence
5cf852b366 Revert "ANDROID: Incremental fs: Don't allow renaming .index directory."
This reverts commit 4e57cc3b29c0eb85e64c9d40a3cbae814f566b4c.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Id7a517f5c3f7ec3a6abb8662bc73b0258995da6a
2021-01-27 08:19:03 -08:00
Paul Lawrence
13837d6463 Revert "ANDROID: Incremental fs: Create mapped file"
This reverts commit 99c5990637408834c265d58be8452a397cdc558c.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I4905262b7a27ce516a193e911f0880d7f129b008
2021-01-27 08:19:03 -08:00
Paul Lawrence
15bd987412 Revert "ANDROID: Incremental fs: Add UID to pending_read"
This reverts commit ea3a54ef5d4ef1cdabccbd091fa9bfe40d02d2a3.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I933e13f999c0a0cfc02d54c3aa83b6fd122d2ce2
2021-01-27 08:19:02 -08:00
Paul Lawrence
fcda7b4e57 Revert "ANDROID: Incremental fs: Separate pseudo-file code"
This reverts commit 664b74271565af7a3c885bba2fdbabd1a2f3e2ea.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: If4c1cee82cae6863f47db091c3f387cbe80d0859
2021-01-27 08:19:02 -08:00
Paul Lawrence
50acfd1851 Revert "ANDROID: Incremental fs: Add .blocks_written file"
This reverts commit 0f577422348f6c355f9bda405f960f8140d4fcdf.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I64dc06b7f763986892f201057d79e69fd7d2810d
2021-01-27 08:19:01 -08:00
Paul Lawrence
28b56592ed Revert "ANDROID: Incremental fs: Remove attributes from file"
This reverts commit 891e6dcc7fec37457b6a55a5f17d5dbf217ae438.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: If7140b7eff55212d1ad6e52c86e68b1aa1b66499
2021-01-27 08:19:00 -08:00
Paul Lawrence
f2ea4d6784 Revert "ANDROID: Incremental fs: Remove back links and crcs"
This reverts commit 1476dc3bbf2eb5036ebc06a1fe0a9f800dd20d3e.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: If8954d7666ac3624ea5cef79f963d4a636243eab
2021-01-27 08:19:00 -08:00
Paul Lawrence
7abdbd1b90 Revert "ANDROID: Incremental fs: Remove block HASH flag"
This reverts commit a1b5df484d5e312319924ed3a0396a7831d73dde.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I4f77e491e7d80d7c184bf5c53dc4468a42fb07fe
2021-01-27 08:18:59 -08:00
Paul Lawrence
5f1840027f Revert "ANDROID: Incremental fs: Make compatible with existing files"
This reverts commit 334f721e51aca57be32e1ef94ae5e8842c5a5284.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I4d3fa77c3a667abcadc73ee5f190ec1bda408087
2021-01-27 08:18:59 -08:00
Paul Lawrence
6a10ea0c73 Revert "ANDROID: Incremental fs: Add INCFS_IOC_GET_BLOCK_COUNT"
This reverts commit 362007bd63e358ef2d46ac234167bd46eaf36066.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Id7c7e23df9b524112f84754dd06324e5e91eb09d
2021-01-27 08:18:58 -08:00
Paul Lawrence
436086d7be Revert "ANDROID: Incremental fs: Add hash block counts to IOC_IOCTL_GET_BLOCK_COUNT"
This reverts commit 94eb31aaa51e23bca64d1fa1248082b22feffb9f.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I1d8762d05b1cbf76edff08a91df1772a7476d3b9
2021-01-27 08:18:58 -08:00
Paul Lawrence
cb39ed9136 Revert "ANDROID: Incremental fs: Fix filled block count from get filled blocks"
This reverts commit 51c82e61db0e43f4c4e63c9a23aa0649bf17db5e.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ieebe0424c0ad6b365f5f655cc1ba9d91c0453760
2021-01-27 08:18:57 -08:00
Paul Lawrence
b517d1c9f8 Revert "ANDROID: Incremental fs: Fix uninitialized variable"
This reverts commit a527a98b1763b03cc9726d4fda70186ae2d7e294.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I5252a89dd25b4820205bfdc6881ffeba40080df7
2021-01-27 08:18:57 -08:00
Paul Lawrence
f26f8de0d9 Revert "ANDROID: Incremental fs: Fix dangling else"
This reverts commit 65652f5a199b74abedda381bcde98405ba326fae.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I6c485eae362279982d43be6bd3e696ef1f42bcdb
2021-01-27 08:18:56 -08:00
Paul Lawrence
225552d81d Revert "ANDROID: Incremental fs: Add .incomplete folder"
This reverts commit 17efe505a4c3df88d3e13051f421d27d7178d47f.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ic968e106dedb1e355a2779deee1fef788e5230fd
2021-01-27 08:18:56 -08:00
Paul Lawrence
f017e3544b Revert "ANDROID: Incremental fs: Add per UID read timeouts"
This reverts commit ebdb37cbb1711123bf88dce1c57b9cdf566fca9c.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: If26171aa33a0041c1322250465afb7a001121c27
2021-01-27 08:18:55 -08:00
Paul Lawrence
d7c055aa83 Revert "ANDROID: Incremental fs: Fix misuse of cpu_to_leXX and poll return"
This reverts commit 1d85ac54f5911dfef2188601d0e1496d01b0fe62.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I43458fd22a095c569e66eec5b26bf6a98ee4d835
2021-01-27 08:18:55 -08:00
Paul Lawrence
a3b4df0333 Revert "ANDROID: Incremental fs: Initialize mount options correctly"
This reverts commit 4d29b3169cd62534df44c4e793d6a88dbba678ba.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I8a0c415a00afb3300ebaa6420919338497563b75
2021-01-27 08:18:54 -08:00
Paul Lawrence
eb182876fd Revert "ANDROID: Incremental fs: Small improvements"
This reverts commit c47f87811d216421b20919fbccc031454890c878.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I04938be6101466e3998372bd574e036f0e2e95e2
2021-01-27 08:18:53 -08:00
Paul Lawrence
6c6b05e83a Revert "ANDROID: Incremental fs: Add zstd compression support"
This reverts commit 9523a669ca4a59e164af6c42ca2a709637050373.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib0a5127350bd88a9352c054e4b7215ffd7196dbf
2021-01-27 08:18:52 -08:00
Paul Lawrence
8e12ff818c Revert "ANDROID: Incremental fs: Fix 32-bit build"
This reverts commit f5e74ee2c465231bcb8c8b582d3c0d86116af47c.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I3001e4ea6e4d570b8ba970e3c876a4d512653ea2
2021-01-27 08:18:52 -08:00
Paul Lawrence
e28158b16a Revert "ANDROID: Incremental fs: Add zstd feature flag"
This reverts commit b08e0c0b32f76b11196ac3ede93e4a72df6c8625.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ie2ef8940218e8fd440dfba22a8b690b0ec6f5945
2021-01-27 08:18:51 -08:00
Paul Lawrence
554a9ae309 Revert "ANDROID: Incremental fs: Add v2 feature flag"
This reverts commit b38636bf5933cdfc7490ed5bb0cec3893a646bab.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I4a157323e62592fe73cf329d253a485ea5e51175
2021-01-27 08:18:51 -08:00
Paul Lawrence
0afc7abd4a Revert "ANDROID: Incremental fs: Change per UID timeouts to microseconds"
This reverts commit f527acab63fd1327c85a27c5be3be4d6222ff053.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I14395c36f8bdcdffc20ff7b6cff2a377e5a45848
2021-01-27 08:18:50 -08:00
Paul Lawrence
b3d3fcefbd Revert "ANDROID: Incremental fs: Set credentials before reading/writing"
This reverts commit 8278cda5d9767db20d87f2d97e135534c43b07ae.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib62275b2041c92842b6392e7974495897b973e2f
2021-01-27 08:18:49 -08:00
Paul Lawrence
8278cda5d9 ANDROID: Incremental fs: Set credentials before reading/writing
Bug: 174692664
Test: incfs_test passes, incremental installs work with ag/13082306
Signed-off-by: Paul Lawrence <paullawrence@google.com>

Change-Id: Ib1c924bbaff759f58f7d83bad8e23d7224ba7ed9
2020-12-10 11:36:08 -08:00
Paul Lawrence
f527acab63 ANDROID: Incremental fs: Change per UID timeouts to microseconds
Bug: 174495152
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Id76d2fec83a0eb7b70ad85f1fac81bf319563a66
2020-12-10 11:36:06 -08:00
Paul Lawrence
b38636bf59 ANDROID: Incremental fs: Add v2 feature flag
Roll report_uid feature flag into v2 feature flag

Bug: 174478527
Test: Feature flag present on boot
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I41ee9715904560004e25cc83a5ccc1eb1bdd2b1f
2020-12-10 11:36:05 -08:00
Paul Lawrence
b08e0c0b32 ANDROID: Incremental fs: Add zstd feature flag
Bug: 174478527
Test: Boot, look for flag
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib573b5420143bd177b50311a3e8cc3a7e8541b96
2020-12-10 11:36:05 -08:00
Paul Lawrence
f5e74ee2c4 ANDROID: Incremental fs: Fix 32-bit build
This commit fixes the error:

fs/incfs/pseudo_files.c:1165:17: error: incompatible types when assigning to
type ‘struct timespec’ from type ‘struct timespec64’

Fixes: 664b74271565 ("ANDROID: Incremental fs: Separate pseudo-file code")
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I0cf24954787c42d475a66ffe0646c47a307bcc26
2020-12-07 16:25:57 +00:00
Paul Lawrence
9523a669ca ANDROID: Incremental fs: Add zstd compression support
Bug: 160634783
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Iba28b535d2d5183859ffc721204b036434132d9b
2020-11-23 12:46:31 -08:00
Paul Lawrence
c47f87811d ANDROID: Incremental fs: Small improvements
Rmove bc_mutex used to protect metadata chain, now that is only
read at file open time
Remove certain unused mount options

Bug: 172482559
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Id70e5a5d08e5de79f391e19ea97e356f39a3ed51
2020-11-23 12:46:31 -08:00
Paul Lawrence
4d29b3169c ANDROID: Incremental fs: Initialize mount options correctly
report_uid was not being initialized, leading to random behavior

Bug: 172480517
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib121136d6f570f99e9060bdde9aa43ff2995514e
2020-11-23 12:46:31 -08:00
Paul Lawrence
1d85ac54f5 ANDROID: Incremental fs: Fix misuse of cpu_to_leXX and poll return
Found by sparse:

fs/incfs/format.c:416:21: warning: incorrect type in assignment (different base types)
fs/incfs/format.c:416:21:    expected restricted __le32 [assigned] [usertype] fh_flags
fs/incfs/format.c:416:21:    got int

fs/incfs/pseudo_files.c:925:25: warning: incorrect type in argument 4 (different base types)
fs/incfs/pseudo_files.c:925:25:    expected unsigned long long [usertype] size
fs/incfs/pseudo_files.c:925:25:    got restricted __le64 [addressable] [assigned] [usertype] size_attr_value
fs/incfs/pseudo_files.c:925:42: warning: incorrect type in argument 5 (different base types)
fs/incfs/pseudo_files.c:925:42:    expected unsigned long long [usertype] offset
fs/incfs/pseudo_files.c:925:42:    got restricted __le64 [usertype]
fs/incfs/pseudo_files.c:1111:24: warning: incorrect type in return expression (different base types)
fs/incfs/pseudo_files.c:1111:24:    expected restricted __poll_t
fs/incfs/pseudo_files.c:1111:24:    got int

Bug: 169258814
Fixes: Sparse errors introduced by 3f4938108a7ad, 8334d69e65f60 and cb776f45766a6
Test: incfs_test passes, sparse shows no errors
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I48596e9521069fc77bf38c345a568529d61c77dc
2020-11-23 12:46:31 -08:00
Paul Lawrence
ebdb37cbb1 ANDROID: Incremental fs: Add per UID read timeouts
Bug: 169056129
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I8cad9ee4095123bafba33abb65bbb339ba6ff8b5
2020-11-23 12:46:31 -08:00