From 060a32a1d66e3191b42b972c6121197146336e24 Mon Sep 17 00:00:00 2001 From: Zihan Dai <99155080+PDGGK@users.noreply.github.com> Date: Sat, 15 Aug 2026 17:45:47 +1000 Subject: [PATCH] fix(services/dbfs): make listed entry paths relative to the root 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. --- core/services/dbfs/src/lister.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/services/dbfs/src/lister.rs b/core/services/dbfs/src/lister.rs index a34fd5ee970c..e3a9f6f55734 100644 --- a/core/services/dbfs/src/lister.rs +++ b/core/services/dbfs/src/lister.rs @@ -59,9 +59,10 @@ impl oio::PageList for DbfsLister { ctx.done = true; for status in decoded_response.files { + let path = build_rel_path(&self.core.root, &status.path); let entry: oio::Entry = match status.is_dir { true => { - let normalized_path = format!("{}/", status.path); + let normalized_path = format!("{path}/"); let mut meta = Metadata::new(EntryMode::DIR); meta.set_last_modified(Timestamp::from_millisecond(status.modification_time)?); oio::Entry::new(&normalized_path, meta) @@ -70,7 +71,7 @@ impl oio::PageList for DbfsLister { let mut meta = Metadata::new(EntryMode::FILE); meta.set_last_modified(Timestamp::from_millisecond(status.modification_time)?); meta.set_content_length(status.file_size as u64); - oio::Entry::new(&status.path, meta) + oio::Entry::new(&path, meta) } }; ctx.entries.push_back(entry);