UPSTREAM: ANDROID: fuse: Don't use readdirplus w/ nodeid 0

If we have a nodeid of 0, we've probably got a backing inode, and a
regular getattr will be fast. Otherwise, userspace is likely ill suited
to properly handle a readdirplus anyways.

Test: fuse_test
Bug: 219958836
Signed-off-by: Daniel Rosenberg <[email protected]>
Change-Id: I02f031d87dcc5fcbe1e080e4f8ec92187b00fe2d
This commit is contained in:
Daniel Rosenberg 2022-07-06 14:57:14 -07:00 • committed by Alexander Martinz
commit a82e300d0c
No known key found for this signature in database
GPG key ID: CF15BDD9A321A9B2

View file

@ -20,6 +20,8 @@ static bool fuse_use_readdirplus(struct inode *dir, struct dir_context *ctx)
if (!fc->do_readdirplus)
return false;
if (fi->nodeid == 0)
return false;
if (!fc->readdirplus_auto)
return true;
if (test_and_clear_bit(FUSE_I_ADVISE_RDPLUS, &fi->state))