Skip to content

Conversation

@aditimittal2003
Copy link
Contributor

This change introduces a new EnableAutoReaddirplus flag to decouple the adaptive ReadDirPlus kernel behavior from the main EnableReaddirplus flag.

Problem:
Previously, enabling EnableReaddirplus would also enable the InitReaddirplusAuto kernel capability. The issue is that for a ls command, the adaptive mode results in the directory listing being performed twice:
The kernel first issues a ReadDirPlus request, optimistically fetching file attributes along with names.
When it sees that the user-space application (ls) does not use the attributes, it falls back and issues ReadDir requests which leads to listing the whole directory again.
This sequence leads to redundant work and unnecessary overhead.

The Solution
This pull request introduces a separate EnableAutoReaddirplus flag in the MountConfig. This decouples the adaptive behavior from the main feature, allowing for more precise control.

The logic is now as follows:
To force ReadDirPlus always: Set EnableReaddirplus: true and EnableAutoReaddirplus: false. This is ideal for workloads like ls -l where attributes are always needed.
To enable adaptive ReadDirPlus: Set both EnableReaddirplus: true and EnableAutoReaddirplus: true.

This change is implemented by making the setting of the fusekernel.InitReaddirplusAuto flag conditional on the new EnableAutoReaddirplus configuration

@aditimittal2003 aditimittal2003 changed the title Add EnableAuto Readdirplus flag to MountConfig Add EnableAutoReaddirplus flag to MountConfig Jul 15, 2025
@stapelberg stapelberg merged commit 8f8de19 into jacobsa:master Jul 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants