commit | b610eff230f2ce92fd48502d71ad0993792f73d3 | [log] [tgz] |
---|---|---|
author | Dmitrii Merkurev <dimorinny@google.com> | Mon May 30 17:26:13 2022 +0000 |
committer | Dmitrii Merkurev <dimorinny@google.com> | Tue May 31 23:58:21 2022 +0000 |
tree | 2d32ac542ccce666898c7a021b6e317571d9bf88 | |
parent | 1e48e8970cca0c063bb24862dc331c80f27ad197 [diff] |
ANDROID: fuse-bpf: use target instead of parent inode to execute backing revalidate Usually as a result of initial fuse lookup with bpf enabled we have following dentry: ----------------------------------------------------------------- | dentry /storage/emulated/0/Android/data | | inode | | backing_inode: /pass_through/emulated/0/Android/data | ----------------------------------------------------------------- Every communication with this folder will have to go through fuse_dentry_revalidate(dentry, flags) which can move forward by: 1. If the timeout is not reached, just ignore it 2. If entry has backing_inode and bpf is not against it, execute revalidate on backing FS (inside kernel) 3. Move to userspace to revalidate But for some reason currently, we're checking parent inode (not one that we wanna revalidate) to have backing inode that we can use to execute operations on. Basically, the whole flow looks like this: 1. Receiving revalidate event for fuse_dentry_revalidate(/storage/emulated/0/Android/data, flags) 2. Checking .../0/Android/ inode to have backing inode <------------------------ Primary problem is HERE 3. Moving to the userspace with pf_lookup(/storage/emulated/0/Android, data) 4. Even though successfully handled lookup on the fuse daemon side, kernel cannot interpret the result due to fuse_simple_request and fuse_lookup_init logic changes <------- Secondary problem is HERE 5. Because of the problems I mentioned before, full lookup is triggered on the kernel side so we receive the second pf_lookup to the userspace Fixing primary problem by executing backing revalidate on the current inode (not the parent one). Bug: 234346312 Test: Manually made sure don't have any userspace calls for interactions inside directory with backing one. Test: Manually check youtube app is successfully saving exo cache into the external storage cache folder. Test: atest --test-mapping packages/providers/MediaProvider Signed-off-by: Dmitrii Merkurev <dimorinny@google.com> Change-Id: Id57f1944302076d93ebef255533dfc53e8c30f20
BEST: Make all of your changes to upstream Linux. If appropriate, backport to the stable releases. These patches will be merged automatically in the corresponding common kernels. If the patch is already in upstream Linux, post a backport of the patch that conforms to the patch requirements below.
EXPORT_SYMBOL_GPL()
require an in-tree modular driver that uses the symbol -- so include the new driver or changes to an existing driver in the same patchset as the export.LESS GOOD: Develop your patches out-of-tree (from an upstream Linux point-of-view). Unless these are fixing an Android-specific bug, these are very unlikely to be accepted unless they have been coordinated with kernel-team@android.com. If you want to proceed, post a patch that conforms to the patch requirements below.
script/checkpatch.pl
UPSTREAM:
, BACKPORT:
, FROMGIT:
, FROMLIST:
, or ANDROID:
.Change-Id:
tag (see https://gerrit-review.googlesource.com/Documentation/user-changeid.html)Bug:
tag.Signed-off-by:
tag by the author and the submitterAdditional requirements are listed below based on patch type
UPSTREAM:
, BACKPORT:
UPSTREAM:
.(cherry picked from commit ...)
lineimportant patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org>
- then Joe Smith would upload the patch for the common kernel as
UPSTREAM: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org> Bug: 135791357 Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1) Signed-off-by: Joe Smith <joe.smith@foo.org>
BACKPORT:
instead of UPSTREAM:
.UPSTREAM:
(cherry picked from commit ...)
lineBACKPORT: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org> Bug: 135791357 Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1) [joe: Resolved minor conflict in drivers/foo/bar.c ] Signed-off-by: Joe Smith <joe.smith@foo.org>
FROMGIT:
, FROMLIST:
,FROMGIT:
(cherry picked from commit <sha1> <repo> <branch>)
. This must be a stable maintainer branch (not rebased, so don't use linux-next
for example).BACKPORT: FROMGIT:
important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org>
- then Joe Smith would upload the patch for the common kernel as
FROMGIT: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org> Bug: 135791357 (cherry picked from commit 878a2fd9de10b03d11d2f622250285c7e63deace https://git.kernel.org/pub/scm/linux/kernel/git/foo/bar.git test-branch) Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <joe.smith@foo.org>
FROMLIST:
Link:
tag with a link to the submittal on lore.kernel.orgBug:
tag with the Android bug (required for patches not accepted into a maintainer tree)BACKPORT: FROMLIST:
FROMLIST: important patch from upstream This is the detailed description of the important patch Signed-off-by: Fred Jones <fred.jones@foo.org> Bug: 135791357 Link: https://lore.kernel.org/lkml/20190619171517.GA17557@someone.com/ Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <joe.smith@foo.org>
ANDROID:
ANDROID:
Fixes:
tag that cites the patch with the bugANDROID: fix android-specific bug in foobar.c This is the detailed description of the important fix Fixes: 1234abcd2468 ("foobar: add cool feature") Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01 Signed-off-by: Joe Smith <joe.smith@foo.org>
ANDROID:
Bug:
tag with the Android bug (required for android-specific features)