fix(services/dbfs): make listed entry paths relative to the root - #8083
Merged
Conversation
The lister emits status.path straight from the response. DbfsCore::list sends the prefix as build_rooted_abs_path(&self.root, path), and DBFS echoes absolute paths under that prefix, so every entry comes back carrying the root and a leading slash -- "/data/dir/f.txt" where the contract asks for "dir/f.txt". alluxio is the exact analogue in this tree: same API shape, appends "/" for directories, and then calls build_rel_path. It is the one every other HTTP service lister uses; dbfs is the only omission. Nothing downstream repairs it. oio::Entry::with only rewrites the empty string to "/". Hoisted rather than called twice because rustfmt splits the line either way, so this is the smaller of the two shapes.
erickguan
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
None. This is the second half of #8079, kept separate because it changes what users see rather than what goes on the wire.
Rationale for this change
The lister emits
status.pathstraight from the response:DbfsCore::listsends the prefix asbuild_rooted_abs_path(&self.root, path), and DBFS echoes absolute paths under that prefix. So every entry comes back carrying the root and a leading slash —/data/dir/f.txtwhere the entry contract asks fordir/f.txt. Even at the default root the leading slash is wrong.alluxiois the exact analogue in this tree — same API shape, appends/for directories, then relativises:Every other HTTP service lister does the same; dbfs is the only one that omits it. Nothing downstream repairs it either —
oio::Entry::withonly rewrites the empty string to"/".What changes are included in this PR?
build_rel_pathapplied once per entry, hoisted above thematchbecause both arms need it. Three lines.Tests
None — the change makes this lister do what
alluxioand the rest already do, and there is no directory under.github/servicesfor dbfs, so nothing exercises the listing path either way.cargo build,cargo clippy -p opendal-service-dbfs --all-targets(zero warnings) andcargo fmt --all -- --checkare clean.Are there any user-facing changes?
Yes: listed entries are relative to the operator root, as the entry contract requires, instead of carrying the root and a leading slash.