This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 7ca9a93905 feat(services): add 3FS USRBIO support (#8434)
7ca9a93905 is described below

commit 7ca9a9390559abc21e204466d7ac25cfe4b4868d
Author: Croxx <[email protected]>
AuthorDate: Mon Nov 23 15:31:13 2026 +0800

    feat(services): add 3FS USRBIO support (#8434)
    
    * feat(services): add 3FS USRBIO support and real service CI
    
    * docs: simplify hf3fs environment example heading
    
    * perf(hf3fs): add read and write benchmark matrix
    
    * bench(hf3fs): align cache policy and I/O chunks with Fs
    
    * fix(hf3fs): address CI documentation and code generation checks
    
    * perf(hf3fs): copy writes before driver submission
    
    * perf(hf3fs): reduce batch and submission stalls
    
    * perf(services/hf3fs): reduce read refill latency
    
    * fix(services/hf3fs): address review feedback and update CI fixture
    
    - Unlink USRBIO data pools immediately after registration via 
hf3fs_iovunlink
    - Pin libhf3fs_api_shared.so with RTLD_NODELETE and cache Arc<Api> 
process-wide
    - Delegate Hf3fsWriter::abort() to PositionWriter::abort() and return 
Ok(()) when unopened
    - Tighten driver submission/timeout handling, clamp ring entries below 
i32::MAX, and surface fatal errors via shared OnceLock
    - Reject non-UTF-8 canonical roots and reuse 
opendal_core::raw::confined_join
    - Exclude hf3fs from generated Go docs, spell out DeepSeek 3FS (Fire-Flyer 
File System), and regenerate docs/capabilities catalogs
    - Stage stripped runtime artifacts for the 3FS CI cache, verify 
FoundationDB SHA-256 digests, document Ubuntu 22.04 transition plan, add 
services-hf3fs to build_all_platforms, remove standalone matrix benchmark 
files, and add mount-free unit tests
    
    * ci(services/hf3fs): install ibverbs-providers and Boost runtime libs in 
setup.sh
    
    Passing --no-install-recommends to apt-get skipped ibverbs-providers (a 
Recommends of libibverbs1), leaving /etc/libibverbs.d missing and causing 
ibv_devinfo -d opendal_rxe to fail. Also include libatomic1 and the Boost 
1.74.0 runtime libraries dynamically linked by Folly so cache-hit runs resolve 
all shared libraries without libboost-all-dev.
    
    * fix(services/hf3fs): join USRBIO workers during driver shutdown
    
    IoDriver discarded its worker JoinHandle, so dropping an Operator returned 
while the read and write workers were still running native teardown. At process 
exit, Folly deleted its thread-local keys before those workers called 
pthread_setspecific, which aborted with EINVAL.
    
    Store the shared driver state in IoDriverInner and join each worker from 
its Drop implementation after closing the request channel and waking any worker 
blocked on retained buffer slots. A worker now also abandons cancelled requests 
before submitting them or waiting for slots, so shutdown cannot stall behind 
buffers that outlive the operator.
    
    * ci(services/hf3fs): install remaining Boost 1.74 runtime libs in 
action.yml
    
    * ci(services/hf3fs): build 3FS with -DPORTABLE=ON and consolidate runtime 
libs
    
    Pass -DPORTABLE=ON to the 3FS CMake configure step so RocksDB does not 
compile with -march=native, preventing cross-runner SIGILL (exit 132) when 
cached binaries are restored onto a different CPU SKU.
    
    Also move the remaining Boost 1.74 runtime packages from action.yml into 
setup.sh (which naturally rotates the cache key) and report all missing shared 
libraries across staged binaries in a single ldd pass.
    
    ---------
    
    Co-authored-by: Xuanwo <[email protected]>
---
 .env.example                                  |   3 +
 .github/scripts/test_behavior/plan.py         |  12 +-
 .github/scripts/test_behavior/test_plan.py    |  13 +
 .github/services/hf3fs/README.md              |  55 ++
 .github/services/hf3fs/single_node/action.yml |  70 +++
 .github/services/hf3fs/single_node/setup.sh   | 147 +++++
 .github/workflows/ci_core.yml                 |   1 +
 .github/workflows/test_behavior_core.yml      |  21 +-
 core/Cargo.lock                               |  17 +
 core/Cargo.toml                               |   2 +
 core/services/hf3fs/Cargo.toml                |  47 ++
 core/services/hf3fs/README.md                 |  81 +++
 core/services/hf3fs/examples/bench_read.rs    |  88 +++
 core/services/hf3fs/src/backend.rs            | 365 +++++++++++
 core/services/hf3fs/src/config.rs             |  55 ++
 core/services/hf3fs/src/driver.rs             | 867 ++++++++++++++++++++++++++
 core/services/hf3fs/src/ffi.rs                | 237 +++++++
 core/services/hf3fs/src/lib.rs                |  39 ++
 core/services/hf3fs/src/reader.rs             |  69 ++
 core/services/hf3fs/src/writer.rs             | 237 +++++++
 core/services/hf3fs/tests/real_service.rs     | 251 ++++++++
 core/src/lib.rs                               |   5 +
 dev/src/generate/docs.rs                      |   2 +-
 dev/src/generate/dotnet.rs                    |   2 +-
 dev/src/generate/java.rs                      |   2 +-
 website/data/capabilities.json                |  18 +
 website/data/services.json                    |  45 ++
 27 files changed, 2745 insertions(+), 6 deletions(-)

diff --git a/.env.example b/.env.example
index ed117e73e4..518f29aa56 100644
--- a/.env.example
+++ b/.env.example
@@ -10,6 +10,9 @@ OPENDAL_GIT_USERNAME=<username>
 OPENDAL_GIT_PASSWORD=<token>
 OPENDAL_GIT_REFERENCE=main
 OPENDAL_GIT_RESOLVE_LFS=true
+# hf3fs
+OPENDAL_HF3FS_ROOT=/path/to/3fs/testdir
+OPENDAL_HF3FS_LIBRARY_PATH=/path/to/libhf3fs_api_shared.so
 # cos
 OPENDAL_COS_BUCKET=opendal-testing-1318209832
 OPENDAL_COS_ENDPOINT=https://cos.ap-singapore.myqcloud.com
diff --git a/.github/scripts/test_behavior/plan.py 
b/.github/scripts/test_behavior/plan.py
index b5abcbf838..561a34bc23 100755
--- a/.github/scripts/test_behavior/plan.py
+++ b/.github/scripts/test_behavior/plan.py
@@ -273,7 +273,7 @@ def _filter_binding_cases(
     cases = [v for v in cases if v["service"] != "aliyun_drive"]
 
     # These fixtures target core services without enabling bindings.
-    cases = [v for v in cases if v["service"] not in ["github", "smb"]]
+    cases = [v for v in cases if v["service"] not in ["github", "hf3fs", 
"smb"]]
 
     if language == "java":
         cases = [
@@ -466,7 +466,15 @@ def plan(changed_files: list[str], mode: str | None = 
None) -> dict[str, Any]:
 
     if len(core_cases) > 0:
         jobs["components"]["core"] = True
-        jobs["core"].append({"os": "ubuntu-latest", "cases": core_cases})
+        linux_cases = [v for v in core_cases if v["service"] != "hf3fs"]
+        hf3fs_cases = [v for v in core_cases if v["service"] == "hf3fs"]
+        if linux_cases:
+            jobs["core"].append({"os": "ubuntu-latest", "cases": linux_cases})
+        if hf3fs_cases:
+            # Ubuntu 24.04 Azure runners currently omit rdma_rxe; see
+            # .github/services/hf3fs/README.md for the transition plan before
+            # Ubuntu 22.04 leaves standard support in May 2027.
+            jobs["core"].append({"os": "ubuntu-22.04", "cases": hf3fs_cases})
 
         # fs is the only service tested on Windows core runners.
         if "fs" in [v["service"] for v in core_cases]:
diff --git a/.github/scripts/test_behavior/test_plan.py 
b/.github/scripts/test_behavior/test_plan.py
index 8df9ccfdbe..2d17b96858 100644
--- a/.github/scripts/test_behavior/test_plan.py
+++ b/.github/scripts/test_behavior/test_plan.py
@@ -107,6 +107,19 @@ class BehaviorTestPlan(unittest.TestCase):
         cases = [v["service"] for v in result["core"][0]["cases"]]
         self.assertEqual(cases, ["hdfs_native"])
 
+    def test_hf3fs_uses_ubuntu_22(self):
+        result = plan(["core/services/hf3fs/src/lib.rs"])
+        self.assertEqual(result["core"], [{
+            "os": "ubuntu-22.04",
+            "cases": [{
+                "service": "hf3fs",
+                "feature": "services-hf3fs",
+                "setups": ["single_node"],
+            }],
+        }])
+        for language in ["java", "python", "ruby", "nodejs", "go", "c", "cpp", 
"dotnet"]:
+            self.assertEqual(result[f"binding_{language}"], [])
+
     def test_group_core_cases_by_service(self):
         cases = [
             {
diff --git a/.github/services/hf3fs/README.md b/.github/services/hf3fs/README.md
new file mode 100644
index 0000000000..959f50d9f3
--- /dev/null
+++ b/.github/services/hf3fs/README.md
@@ -0,0 +1,55 @@
+# DeepSeek 3FS (Fire-Flyer File System) behavior tests
+
+The `single_node` setup starts a real, single-replica DeepSeek 3FS cluster on a
+hosted Ubuntu 22.04 runner. It uses SoftRoCE (`rdma_rxe`), FoundationDB, and
+ordinary data directories; it requires neither a physical RDMA adapter nor a
+dedicated disk.
+
+CI caches a stripped runtime staging directory (the five 3FS executables,
+`libhf3fs_api_shared.so`, staged runtime shared libraries including libfuse
+3.16.2, and the `tests/fuse/` launcher and configs), runs the focused USRBIO
+tests and the standard behavior suite, and stops the cluster and removes the
+RXE device afterward. Build-only apt packages and the libfuse/3FS builds run
+only on a cache miss, and FoundationDB downloads are verified against pinned
+SHA-256 digests before installation. The job skips the common setup's
+standalone RocksDB build because the Rust service does not depend on it; 3FS
+builds its own bundled RocksDB.
+
+## Runner plan beyond Ubuntu 22.04
+
+The behavior planner selects `ubuntu-22.04` because GitHub's hosted
+`ubuntu-24.04` Azure kernel currently omits `rdma_rxe`. Ubuntu 22.04 leaves
+standard support in May 2027. Before that cutoff:
+
+1. Re-check newer hosted GitHub Ubuntu runner images (such as updated
+   `ubuntu-24.04` or `ubuntu-26.04` kernels) for `rdma_rxe` support and update
+   `.github/scripts/test_behavior/plan.py` and
+   `.github/services/hf3fs/single_node/action.yml` once a newer hosted image
+   supports SoftRoCE.
+2. If hosted runners still lack `rdma_rxe` ahead of Ubuntu 22.04 retirement,
+   move the `hf3fs` behavior job to a self-hosted or custom-kernel Linux runner
+   with RDMA/SoftRoCE enabled (or a dedicated nightly lane if PR-time hosted
+   runners cannot provide RXE).
+
+## Running locally on an existing 3FS deployment
+
+To test an existing Linux deployment, use a real 3FS FUSE mount and the 
matching
+USRBIO client library.
+
+Create a dedicated test directory on the mount. Set `OPENDAL_HF3FS_ROOT` to its
+absolute path and `OPENDAL_HF3FS_LIBRARY_PATH` to `libhf3fs_api_shared.so`.
+Set `OPENDAL_TEST=hf3fs` and `OPENDAL_DISABLE_RANDOM_ROOT=true`, since the 
service
+requires its root to exist before construction.
+
+From `core/`, run:
+
+```shell
+cargo test --test behavior --features tests,services-hf3fs
+cargo test -p opendal-service-hf3fs --test real_service -- --ignored
+cargo run --release -p opendal-service-hf3fs --example bench_read
+```
+
+The `bench_read` example compares 1 MiB streaming reads at concurrency 1 and 16
+against `Fs` on the same file and mount. It warms each path and reports four
+measured passes. Results depend on client configuration, caching, and cluster
+load.
diff --git a/.github/services/hf3fs/single_node/action.yml 
b/.github/services/hf3fs/single_node/action.yml
new file mode 100644
index 0000000000..4e9f0229d8
--- /dev/null
+++ b/.github/services/hf3fs/single_node/action.yml
@@ -0,0 +1,70 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: single_node
+description: Test 3FS with one storage node, one replica, and SoftRoCE
+
+runs:
+  using: composite
+  steps:
+    - uses: actions/cache/restore@v5
+      id: cache
+      with:
+        path: ${{ runner.temp }}/3fs
+        key: hf3fs-runtime-ubuntu22-${{ 
hashFiles('.github/services/hf3fs/single_node/setup.sh') }}
+    - name: Prepare 3FS
+      shell: bash
+      env:
+        CACHE_HIT: ${{ steps.cache.outputs.cache-hit }}
+      run: bash .github/services/hf3fs/single_node/setup.sh
+    - uses: actions/cache/save@v5
+      if: steps.cache.outputs.cache-hit != 'true'
+      with:
+        path: ${{ runner.temp }}/3fs
+        key: hf3fs-runtime-ubuntu22-${{ 
hashFiles('.github/services/hf3fs/single_node/setup.sh') }}
+    - name: Start 3FS
+      shell: bash
+      run: |
+        runtime_dir="$RUNNER_TEMP/3fs"
+        cluster="$RUNNER_TEMP/hf3fs-cluster"
+        sed -i '/\[ib_devices\]/a device_filter = ["opendal_rxe"]' \
+          "$runtime_dir"/tests/fuse/config/*launcher.toml 
"$runtime_dir"/tests/fuse/config/admin_cli.toml
+        sed -i "s/start_level = 'NONE'/start_level = 'WARN'/" 
"$runtime_dir"/tests/fuse/config/*.toml
+        sudo systemd-run --unit=opendal-hf3fs --uid="$(id -u)" \
+          --working-directory="$RUNNER_TEMP" \
+          --property=LimitMEMLOCK=infinity --property=TimeoutStopSec=10s \
+          bash "$runtime_dir/tests/fuse/run.sh" "$runtime_dir/bin" "$cluster"
+        for _ in $(seq 1 120); do
+          if mountpoint -q "$cluster/mnt" && [[ -d "$cluster/mnt/test" ]]; then
+            break
+          fi
+          if ! systemctl is-active --quiet opendal-hf3fs; then
+            sudo journalctl -u opendal-hf3fs --no-pager
+            exit 1
+          fi
+          sleep 1
+        done
+        mountpoint "$cluster/mnt"
+        test -d "$cluster/mnt/test"
+        echo "OPENDAL_HF3FS_ROOT=$cluster/mnt/test" >> "$GITHUB_ENV"
+        echo 
"OPENDAL_HF3FS_LIBRARY_PATH=$runtime_dir/lib/libhf3fs_api_shared.so" >> 
"$GITHUB_ENV"
+        echo "OPENDAL_DISABLE_RANDOM_ROOT=true" >> "$GITHUB_ENV"
+        echo "RUST_TEST_THREADS=2" >> "$GITHUB_ENV"
+    - name: Test USRBIO
+      shell: bash
+      working-directory: core
+      run: cargo test --locked -p opendal-service-hf3fs --test real_service -- 
--ignored
diff --git a/.github/services/hf3fs/single_node/setup.sh 
b/.github/services/hf3fs/single_node/setup.sh
new file mode 100644
index 0000000000..0c6f810247
--- /dev/null
+++ b/.github/services/hf3fs/single_node/setup.sh
@@ -0,0 +1,147 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -euo pipefail
+
+STAGE_DIR="$RUNNER_TEMP/3fs"
+FDB_CLIENTS_URL="https://github.com/apple/foundationdb/releases/download/7.1.61/foundationdb-clients_7.1.61-1_amd64.deb";
+FDB_CLIENTS_SHA256="c8ffc7604795719a11c615236c49cc8ac277fddd28caaa5fe670b11e6a54dc2f"
+FDB_SERVER_URL="https://github.com/apple/foundationdb/releases/download/7.1.61/fdbserver.x86_64";
+FDB_SERVER_SHA256="6fd31402d5cd0a797307077d6f39591a806d39068fc6a28e3c6cb96b96081438"
+
+sudo apt-get update -qq
+# Runtime packages required on both cache hit and cache miss.
+sudo apt-get install -y --no-install-recommends \
+  "linux-modules-extra-$(uname -r)" rdma-core ibverbs-utils ibverbs-providers \
+  fuse3 gettext-base \
+  libatomic1 libuv1 liblz4-1 liblzma5 libdouble-conversion3 \
+  libdwarf1 libunwind8 libaio1 libgflags2.2 libgoogle-glog0v5 \
+  libgoogle-perftools4 libssl3 libibverbs1 libnuma1 \
+  libevent-2.1-7 libevent-extra-2.1-7 libevent-pthreads-2.1-7 libfmt8 \
+  libboost-atomic1.74.0 libboost-chrono1.74.0 libboost-container1.74.0 \
+  libboost-context1.74.0 libboost-coroutine1.74.0 libboost-date-time1.74.0 \
+  libboost-filesystem1.74.0 libboost-iostreams1.74.0 \
+  libboost-program-options1.74.0 libboost-regex1.74.0 \
+  libboost-system1.74.0 libboost-thread1.74.0
+
+sudo modprobe rdma_rxe
+device=$(ip -4 route show default | awk 'NR == 1 {print $5}')
+sudo rdma link add opendal_rxe type rxe netdev "$device"
+ibv_devinfo -d opendal_rxe
+
+curl -fsSL --retry 3 -o "$RUNNER_TEMP/fdb.deb" "$FDB_CLIENTS_URL"
+echo "$FDB_CLIENTS_SHA256  $RUNNER_TEMP/fdb.deb" | sha256sum -c -
+sudo dpkg -i "$RUNNER_TEMP/fdb.deb"
+
+curl -fsSL --retry 3 -o "$RUNNER_TEMP/fdbserver" "$FDB_SERVER_URL"
+echo "$FDB_SERVER_SHA256  $RUNNER_TEMP/fdbserver" | sha256sum -c -
+sudo install -m 755 "$RUNNER_TEMP/fdbserver" /usr/local/bin/fdbserver
+
+if [[ "${CACHE_HIT:-false}" != true ]]; then
+  # Build-only packages and libfuse 3.16.2 build stay on the cache-miss path.
+  sudo apt-get install -y --no-install-recommends \
+    cmake ninja-build libuv1-dev liblz4-dev liblzma-dev 
libdouble-conversion-dev \
+    libdwarf-dev libunwind-dev libaio-dev libgflags-dev libgoogle-glog-dev \
+    libgtest-dev libgmock-dev clang-14 clang-format-14 lld-14 
libgoogle-perftools-dev \
+    libssl-dev gcc-12 g++-12 libboost-all-dev meson libibverbs-dev libnuma-dev 
\
+    libevent-dev libfmt-dev autoconf automake libtool gettext
+
+  git clone -q --depth 1 --branch fuse-3.16.2 
https://github.com/libfuse/libfuse.git "$RUNNER_TEMP/libfuse"
+  meson setup "$RUNNER_TEMP/libfuse/build" "$RUNNER_TEMP/libfuse" 
-Dexamples=false -Dtests=false
+  ninja -C "$RUNNER_TEMP/libfuse/build"
+  sudo ninja -C "$RUNNER_TEMP/libfuse/build" install
+  sudo ldconfig
+
+  SRC_DIR="$RUNNER_TEMP/3fs-src"
+  git clone -q https://github.com/deepseek-ai/3FS.git "$SRC_DIR"
+  cd "$SRC_DIR"
+  git checkout 22fca04564c7cc230fd8b9523b8b92864e1dad47
+  git submodule update --init --recursive --depth 1 --jobs 4
+  ./patches/apply.sh
+  cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=clang-14 
-DCMAKE_CXX_COMPILER=clang++-14 \
+    -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE='-O1 -DNDEBUG' \
+    -DCMAKE_CXX_FLAGS_RELEASE='-O1 -DNDEBUG' -DSHUFFLE_METHOD=g++11 
-DPORTABLE=ON
+  cmake --build build -j 3 --target mgmtd_main meta_main storage_main 
hf3fs_fuse_main admin_cli hf3fs_api_shared
+
+  rm -rf "$STAGE_DIR"
+  mkdir -p "$STAGE_DIR/bin" "$STAGE_DIR/lib" "$STAGE_DIR/fuse" 
"$STAGE_DIR/tests"
+
+  bins=(mgmtd_main meta_main storage_main hf3fs_fuse_main admin_cli)
+  for bin in "${bins[@]}"; do
+    cp -L "$SRC_DIR/build/bin/$bin" "$STAGE_DIR/bin/$bin"
+  done
+  cp -L "$SRC_DIR/build/src/lib/api/libhf3fs_api_shared.so" 
"$STAGE_DIR/lib/libhf3fs_api_shared.so"
+
+  # Stage any shared libraries produced inside the 3FS build tree (e.g. 
jemalloc).
+  for elf in "$STAGE_DIR"/bin/* "$STAGE_DIR/lib/libhf3fs_api_shared.so"; do
+    while IFS= read -r lib_path; do
+      [[ -n "$lib_path" ]] || continue
+      dest="$STAGE_DIR/lib/$(basename "$lib_path")"
+      [[ -e "$dest" ]] || cp -L "$lib_path" "$dest"
+    done < <(ldd "$elf" | awk -v prefix="$SRC_DIR/build/" 'index($3, prefix) 
== 1 {print $3}')
+  done
+
+  # Stage libfuse 3.16.2 runtime libraries and helper binaries.
+  while IFS= read -r fuse_lib; do
+    cp -a "$fuse_lib" "$STAGE_DIR/lib/"
+  done < <(find /usr/local/lib /usr/local/lib/x86_64-linux-gnu -maxdepth 1 
-name 'libfuse3.so*' 2>/dev/null || true)
+  test -e "$STAGE_DIR/lib/libfuse3.so.3"
+  for fuse_bin in /usr/local/bin/fusermount3 /usr/local/sbin/mount.fuse3; do
+    if [[ -f "$fuse_bin" ]]; then
+      cp -L "$fuse_bin" "$STAGE_DIR/fuse/$(basename "$fuse_bin")"
+    fi
+  done
+
+  # Stage launcher script and cluster configs.
+  cp -a "$SRC_DIR/tests/fuse" "$STAGE_DIR/tests/fuse"
+
+  # Strip staged binaries and shared libraries to keep the cache compact.
+  strip --strip-all "$STAGE_DIR"/bin/*
+  for fuse_bin in "$STAGE_DIR"/fuse/*; do
+    [[ -f "$fuse_bin" ]] && strip --strip-all "$fuse_bin"
+  done
+  find "$STAGE_DIR/lib" -maxdepth 1 -type f -name '*.so*' -exec strip 
--strip-unneeded {} +
+
+  # Drop the build tree before validating runtime resolution.
+  rm -rf "$SRC_DIR" "$RUNNER_TEMP/libfuse"
+  du -sh "$STAGE_DIR"
+  ls -lh "$STAGE_DIR/bin" "$STAGE_DIR/lib"
+fi
+
+# Install staged libfuse helpers and register staged shared libraries.
+if [[ -f "$STAGE_DIR/fuse/fusermount3" ]]; then
+  sudo install -m 4755 "$STAGE_DIR/fuse/fusermount3" /usr/local/bin/fusermount3
+fi
+if [[ -f "$STAGE_DIR/fuse/mount.fuse3" ]]; then
+  sudo install -m 755 "$STAGE_DIR/fuse/mount.fuse3" /usr/local/sbin/mount.fuse3
+fi
+echo "$STAGE_DIR/lib" | sudo tee /etc/ld.so.conf.d/00-hf3fs.conf >/dev/null
+sudo ldconfig
+
+# Verify all staged runtime dependencies resolve without the build tree.
+missing=0
+for elf in "$STAGE_DIR"/bin/* "$STAGE_DIR/lib/libhf3fs_api_shared.so"; do
+  if ldd "$elf" | grep -q 'not found'; then
+    echo "Missing runtime shared library for $elf:" >&2
+    ldd "$elf" >&2
+    missing=1
+  fi
+done
+if [[ "$missing" -ne 0 ]]; then
+  exit 1
+fi
diff --git a/.github/workflows/ci_core.yml b/.github/workflows/ci_core.yml
index 62fb1d412d..e58d164ae5 100644
--- a/.github/workflows/ci_core.yml
+++ b/.github/workflows/ci_core.yml
@@ -233,6 +233,7 @@ jobs:
             # services-hdfs
             services-http
             services-hf
+            services-hf3fs
             services-ipfs
             services-ipmfs
             services-memcached
diff --git a/.github/workflows/test_behavior_core.yml 
b/.github/workflows/test_behavior_core.yml
index 72f8203f35..afb03b3230 100644
--- a/.github/workflows/test_behavior_core.yml
+++ b/.github/workflows/test_behavior_core.yml
@@ -54,7 +54,8 @@ jobs:
         uses: ./.github/actions/setup
         with:
           need-protoc: true
-          need-rocksdb: true
+          # 3FS builds its bundled RocksDB; its Rust service does not use this 
copy.
+          need-rocksdb: ${{ matrix.cases.service != 'hf3fs' }}
           github-token: ${{ secrets.GITHUB_TOKEN }}
 
       - name: Setup 1Password Connect
@@ -88,3 +89,21 @@ jobs:
           feature: ${{ matrix.cases.feature }}
         env:
           GITHUB_TOKEN: ${{ inputs.enable_secrets && secrets.GITHUB_TOKEN || 
'' }}
+
+      - name: Stop 3FS
+        if: always() && matrix.cases.service == 'hf3fs'
+        shell: bash
+        run: |
+          sudo journalctl -u opendal-hf3fs --no-pager > 
"$RUNNER_TEMP/hf3fs-journal.log" 2>&1 || true
+          sudo systemctl stop opendal-hf3fs || true
+          fusermount3 -u "$RUNNER_TEMP/hf3fs-cluster/mnt" 2>/dev/null || true
+          sudo rdma link delete opendal_rxe 2>/dev/null || true
+
+      - name: Upload 3FS logs
+        if: always() && matrix.cases.service == 'hf3fs'
+        uses: actions/upload-artifact@v7
+        with:
+          name: hf3fs-logs
+          path: |
+            ${{ runner.temp }}/hf3fs-journal.log
+            ${{ runner.temp }}/hf3fs-cluster/log
diff --git a/core/Cargo.lock b/core/Cargo.lock
index 828a5629f7..f04e35a2d4 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -7402,6 +7402,7 @@ dependencies = [
  "opendal-service-hdfs",
  "opendal-service-hdfs-native",
  "opendal-service-hf",
+ "opendal-service-hf3fs",
  "opendal-service-http",
  "opendal-service-ipfs",
  "opendal-service-ipmfs",
@@ -8368,6 +8369,22 @@ dependencies = [
  "tokio",
 ]
 
+[[package]]
+name = "opendal-service-hf3fs"
+version = "0.59.5"
+dependencies = [
+ "bytes",
+ "futures",
+ "libc",
+ "libloading 0.8.9",
+ "opendal-core",
+ "opendal-executor-tokio",
+ "opendal-service-fs",
+ "serde",
+ "tempfile",
+ "tokio",
+]
+
 [[package]]
 name = "opendal-service-http"
 version = "0.59.5"
diff --git a/core/Cargo.toml b/core/Cargo.toml
index db3a88ff47..68a2cea02a 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -194,6 +194,7 @@ services-gridfs = ["dep:opendal-service-gridfs"]
 services-hdfs = ["dep:opendal-service-hdfs"]
 services-hdfs-native = ["dep:opendal-service-hdfs-native"]
 services-hf = ["dep:opendal-service-hf"]
+services-hf3fs = ["dep:opendal-service-hf3fs"]
 services-http = ["dep:opendal-service-http"]
 services-huggingface = ["services-hf"]
 services-ipfs = ["dep:opendal-service-ipfs"]
@@ -325,6 +326,7 @@ opendal-service-gridfs = { path = "services/gridfs", 
version = "0.59.5", optiona
 opendal-service-hdfs = { path = "services/hdfs", version = "0.59.5", optional 
= true, default-features = false }
 opendal-service-hdfs-native = { path = "services/hdfs-native", version = 
"0.59.5", optional = true, default-features = false }
 opendal-service-hf = { path = "services/hf", version = "0.59.5", optional = 
true, default-features = false }
+opendal-service-hf3fs = { path = "services/hf3fs", version = "0.59.5", 
optional = true, default-features = false }
 opendal-service-http = { path = "services/http", version = "0.59.5", optional 
= true, default-features = false }
 opendal-service-ipfs = { path = "services/ipfs", version = "0.59.5", optional 
= true, default-features = false }
 opendal-service-ipmfs = { path = "services/ipmfs", version = "0.59.5", 
optional = true, default-features = false }
diff --git a/core/services/hf3fs/Cargo.toml b/core/services/hf3fs/Cargo.toml
new file mode 100644
index 0000000000..8adeced030
--- /dev/null
+++ b/core/services/hf3fs/Cargo.toml
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL DeepSeek 3FS (Fire-Flyer File System) service 
implementation"
+name = "opendal-service-hf3fs"
+readme = "README.md"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[target.'cfg(target_os = "linux")'.dependencies]
+bytes = { workspace = true }
+libc = "0.2"
+libloading = "0.8"
+opendal-core = { path = "../../core", version = "0.59.5", default-features = 
false }
+opendal-service-fs = { path = "../fs", version = "0.59.5", default-features = 
false }
+serde = { workspace = true, features = ["derive"] }
+tokio = { workspace = true, features = ["rt", "sync"] }
+
+[target.'cfg(target_os = "linux")'.dev-dependencies]
+futures = { workspace = true }
+opendal-executor-tokio = { path = "../../executors/tokio", version = "0.59.5" }
+tempfile = "3"
+tokio = { workspace = true, features = ["macros", "rt-multi-thread", "time"] }
diff --git a/core/services/hf3fs/README.md b/core/services/hf3fs/README.md
new file mode 100644
index 0000000000..6997c1739e
--- /dev/null
+++ b/core/services/hf3fs/README.md
@@ -0,0 +1,81 @@
+# Apache OpenDALâ„¢ DeepSeek 3FS Service
+
+`Hf3fs` accesses DeepSeek's 3FS (Fire-Flyer File System) by reading and writing
+through the 3FS USRBIO shared-memory interface while using the mounted
+filesystem for metadata operations. It requires Linux, a running 3FS FUSE
+client, and a compatible `libhf3fs_api_shared.so` implementing the public
+[`hf3fs_usrbio.h` 
API](https://github.com/deepseek-ai/3FS/blob/main/src/lib/api/hf3fs_usrbio.h).
+The library is loaded at runtime; building OpenDAL does not require a 3FS SDK.
+
+Enable `services-hf3fs` in `opendal`, or use the split crates:
+
+```rust,no_run
+use opendal_core::{Operator, Result};
+use opendal_service_hf3fs::Hf3fs;
+
+fn operator() -> Result<Operator> {
+    Operator::new(Hf3fs::default()
+        .root("/mnt/3fs/data")
+        .library_path("/opt/3fs/lib/libhf3fs_api_shared.so"))
+}
+```
+
+The root must be an existing absolute directory on 3FS. The service discovers
+its mount point. By default, the dynamic loader searches for
+`libhf3fs_api_shared.so`; `library_path` selects a specific installation.
+Use the client library distributed with your 3FS deployment.
+
+The service supports stat, range reads, streaming writes, create directory,
+list, delete, recursive delete, and rename. Writes create parent directories
+and replace existing files; `if_not_exists` rejects an existing file.
+Closing a writer waits for writes and synchronizes the file. Writes are not
+atomic, and failed or aborted writes can leave partial files. Append, native
+copy, presign, and rollback on abort are unsupported. Operations require a
+Tokio runtime. The operation context supplies the executor for concurrent 
writes.
+
+## Memory and concurrency
+
+Each operator owns a read driver and a write driver. Each driver submits and
+reaps completions on its own thread. Requests complete independently so a slow
+request does not delay the rest of a batch. `queue_depth` defaults to 32 
requests per ring;
+`block_size` defaults to 1 MiB. Shared memory uses approximately
+`3 * queue_depth * block_size`, plus the rings, and request queues are bounded.
+The submission rings have extra entries for out-of-order completions; the 
number
+of in-flight requests remains bounded by `queue_depth`.
+Cloned operators share these resources.
+
+After read completions, the driver briefly polls for follow-up requests before
+blocking again. This reduces submission latency at the cost of some additional
+CPU time while reads are active. Idle drivers block on their request queues.
+
+Reads return shared-memory-backed buffers without copying while fewer than
+`queue_depth` slots remain retained by callers. Additional completions copy to
+ordinary buffers on the calling task so copying does not block the driver.
+The driver waits for a free slot if completed reads awaiting their callers fill
+the pool. Collecting large files still progresses because retained buffers
+remain bounded by `queue_depth`. Buffer clones retain their slot until the 
last clone is dropped,
+even after the operator is dropped. Writes reserve a shared-memory slot and 
copy
+their input on the calling task before submitting it to the driver. Concurrent
+tasks can copy in parallel on a multithreaded runtime; the write pool remains
+bounded by `queue_depth`.
+
+Cancelling an awaiting future does not cancel submitted native I/O. The driver
+retains the file and buffer until completion. If submission or completion
+collection fails fatally, the driver stops and reports errors. Since USRBIO
+provides no cancellation fence, resources still involved in native I/O remain
+allocated until process exit. Rebuild the operator after a driver failure.
+A stalled client can also keep its driver and in-flight resources alive;
+operation timeouts do not release native buffers.
+
+## Testing on 3FS
+
+Set `OPENDAL_HF3FS_ROOT` to an existing, writable test directory on a real 3FS
+mount. Optionally set `OPENDAL_HF3FS_LIBRARY_PATH`. From `core/`, run:
+
+```shell
+cargo test -p opendal-service-hf3fs --test real_service -- --ignored
+OPENDAL_TEST=hf3fs OPENDAL_DISABLE_RANDOM_ROOT=true cargo test --test behavior 
--features tests,services-hf3fs
+```
+
+The focused tests create and remove their own subdirectories. Use a dedicated
+test root for the behavior suite. Neither test command needs a mock service.
diff --git a/core/services/hf3fs/examples/bench_read.rs 
b/core/services/hf3fs/examples/bench_read.rs
new file mode 100644
index 0000000000..4e4ccc14f2
--- /dev/null
+++ b/core/services/hf3fs/examples/bench_read.rs
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Compare streaming reads through Fs and USRBIO on the same 3FS file.
+#[cfg(target_os = "linux")]
+use std::time::Instant;
+
+#[cfg(target_os = "linux")]
+use futures::TryStreamExt;
+#[cfg(target_os = "linux")]
+use opendal_core::{Executor, Operator, Result};
+#[cfg(target_os = "linux")]
+use opendal_executor_tokio::TokioExecutor;
+#[cfg(target_os = "linux")]
+use opendal_service_hf3fs::Hf3fs;
+
+#[cfg(not(target_os = "linux"))]
+fn main() {
+    eprintln!("The 3FS benchmark requires Linux.");
+}
+
+#[cfg(target_os = "linux")]
+#[tokio::main]
+async fn main() -> Result<()> {
+    let root = std::env::var("OPENDAL_HF3FS_ROOT").expect("set 
OPENDAL_HF3FS_ROOT");
+    let directory = tempfile::tempdir_in(root).expect("create benchmark 
directory");
+    let root = directory.path().to_str().unwrap();
+    let mut builder = Hf3fs::default().root(root);
+    if let Ok(library) = std::env::var("OPENDAL_HF3FS_LIBRARY_PATH") {
+        builder = builder.library_path(&library);
+    }
+    let executor = Executor::with(TokioExecutor::default());
+    let hf3fs = Operator::new(builder)?;
+    let hf3fs_ctx = hf3fs.context().with_executor(executor.clone());
+    let hf3fs = hf3fs.with_context(hf3fs_ctx);
+    let fs = Operator::new(opendal_service_fs::Fs::default().root(root))?;
+    let fs_ctx = fs.context().with_executor(executor);
+    let fs = fs.with_context(fs_ctx);
+    fs.write("data", vec![0x5a; 64 * 1024 * 1024]).await?;
+
+    for concurrent in [1, 16] {
+        for (name, operator) in [("fs", &fs), ("hf3fs", &hf3fs)] {
+            // Warm the same file before measuring four complete streaming 
reads.
+            read(operator, concurrent).await?;
+            let start = Instant::now();
+            let mut bytes = 0;
+            for _ in 0..4 {
+                bytes += read(operator, concurrent).await?;
+            }
+            println!(
+                "{name} concurrency={concurrent}: {:.1} MiB/s",
+                bytes as f64 / start.elapsed().as_secs_f64() / 1048576.0
+            );
+        }
+    }
+    Ok(())
+}
+
+#[cfg(target_os = "linux")]
+async fn read(operator: &Operator, concurrent: usize) -> Result<usize> {
+    let mut stream = operator
+        .reader_with("data")
+        .chunk(1024 * 1024)
+        .concurrent(concurrent)
+        .await?
+        .into_stream(..)
+        .await?;
+    let mut size = 0;
+    while let Some(buffer) = stream.try_next().await? {
+        size += buffer.len();
+        std::hint::black_box(buffer);
+    }
+    Ok(size)
+}
diff --git a/core/services/hf3fs/src/backend.rs 
b/core/services/hf3fs/src/backend.rs
new file mode 100644
index 0000000000..d3053ea015
--- /dev/null
+++ b/core/services/hf3fs/src/backend.rs
@@ -0,0 +1,365 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::ffi::CString;
+use std::os::unix::ffi::OsStrExt;
+use std::path::{Path, PathBuf};
+use std::sync::Arc;
+
+use opendal_core::raw::*;
+use opendal_core::*;
+
+use crate::HF3FS_SCHEME;
+use crate::config::Hf3fsConfig;
+use crate::driver::IoDriver;
+use crate::ffi::Api;
+use crate::reader::Hf3fsReader;
+use crate::writer::Hf3fsWriter;
+
+/// Access DeepSeek's 3FS (Fire-Flyer File System) through USRBIO for data and
+/// the mounted filesystem for metadata.
+///
+/// Requires Linux, a running 3FS FUSE client, and its compatible USRBIO shared
+/// library. The root must already exist. Reads retain shared memory while 
space
+/// permits; writes copy into shared memory. See the crate documentation for
+/// memory limits and failure semantics.
+#[derive(Debug, Default)]
+pub struct Hf3fsBuilder {
+    pub(crate) config: Hf3fsConfig,
+}
+
+impl Hf3fsBuilder {
+    /// Set the existing absolute directory used as the storage root.
+    pub fn root(mut self, root: &str) -> Self {
+        self.config.root = Some(root.into());
+        self
+    }
+
+    /// Set the path to the compatible `libhf3fs_api_shared.so` library.
+    /// Defaults to the system dynamic loader's search path.
+    pub fn library_path(mut self, path: &str) -> Self {
+        self.config.library_path = Some(path.into());
+        self
+    }
+
+    /// Set the positive maximum number of in-flight requests per ring.
+    /// Defaults to 32. Each operator owns one read ring and one write ring.
+    pub fn queue_depth(mut self, depth: usize) -> Self {
+        self.config.queue_depth = Some(depth);
+        self
+    }
+
+    /// Set the positive maximum request size in bytes. Defaults to 1 MiB.
+    /// Shared memory usage is approximately `3 * queue_depth * block_size`.
+    pub fn block_size(mut self, size: usize) -> Self {
+        self.config.block_size = Some(size);
+        self
+    }
+}
+
+impl Builder for Hf3fsBuilder {
+    type Config = Hf3fsConfig;
+
+    fn build(self) -> Result<impl Service> {
+        let depth = self.config.queue_depth.unwrap_or(32);
+        let block_size = self.config.block_size.unwrap_or(1024 * 1024);
+        if depth == 0
+            || depth >= i32::MAX as usize
+            || block_size == 0
+            || depth
+                .checked_mul(3)
+                .and_then(|n| n.checked_mul(block_size))
+                .is_none_or(|n| n > isize::MAX as usize)
+        {
+            return Err(Error::new(
+                ErrorKind::ConfigInvalid,
+                "invalid USRBIO queue depth or block size",
+            ));
+        }
+        let root = self
+            .config
+            .root
+            .as_deref()
+            .filter(|p| Path::new(p).is_absolute())
+            .ok_or_else(|| {
+                Error::new(ErrorKind::ConfigInvalid, "an absolute 3FS root is 
required")
+            })?;
+        let root = Path::new(root).canonicalize().map_err(new_std_io_error)?;
+        if !root.is_dir() {
+            return Err(Error::new(
+                ErrorKind::ConfigInvalid,
+                "3FS root must be a directory",
+            ));
+        }
+        let root_str = root
+            .to_str()
+            .ok_or_else(|| Error::new(ErrorKind::ConfigInvalid, "3FS root must 
be valid UTF-8"))?;
+        let api = Api::load(Path::new(
+            self.config
+                .library_path
+                .as_deref()
+                .unwrap_or("libhf3fs_api_shared.so"),
+        ))?;
+        let c_root = CString::new(root.as_os_str().as_bytes())
+            .map_err(|e| Error::new(ErrorKind::ConfigInvalid, "root contains 
NUL").set_source(e))?;
+        let mount = api.mount_point(&c_root)?;
+        let read = IoDriver::start(api.clone(), mount.clone(), depth, 
block_size, true)?;
+        let write = IoDriver::start(api.clone(), mount, depth, block_size, 
false)?;
+        let metadata = 
Arc::new(opendal_service_fs::Fs::default().root(root_str).build()?);
+        Ok(Hf3fsBackend {
+            core: Arc::new(Hf3fsCore {
+                root,
+                api,
+                read,
+                write,
+            }),
+            metadata,
+        })
+    }
+}
+
+pub(crate) struct Hf3fsCore {
+    pub root: PathBuf,
+    pub api: Arc<Api>,
+    pub read: IoDriver,
+    pub write: IoDriver,
+}
+
+impl Hf3fsCore {
+    pub fn path(&self, path: &str) -> Result<PathBuf> {
+        confined_join(&self.root, path)
+    }
+}
+
+struct Hf3fsBackend {
+    core: Arc<Hf3fsCore>,
+    metadata: Servicer,
+}
+
+impl std::fmt::Debug for Hf3fsBackend {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        f.debug_struct("Hf3fsBackend")
+            .field("root", &self.core.root)
+            .finish_non_exhaustive()
+    }
+}
+
+impl Service for Hf3fsBackend {
+    type Reader = oio::PositionReader<Hf3fsReader>;
+    type Writer = Hf3fsWriter;
+    type Lister = oio::Lister;
+    type Deleter = oio::Deleter;
+    type Copier = ();
+    type Composer = ();
+
+    fn info(&self) -> ServiceInfo {
+        ServiceInfo::new(HF3FS_SCHEME, self.core.root.to_string_lossy(), "")
+    }
+
+    fn capability(&self) -> Capability {
+        Capability {
+            stat: true,
+            read: true,
+            write: true,
+            write_can_empty: true,
+            write_can_multi: true,
+            write_with_if_not_exists: true,
+            create_dir: true,
+            list: true,
+            delete: true,
+            delete_with_recursive: true,
+            rename: true,
+            shared: true,
+            ..Default::default()
+        }
+    }
+
+    fn read(&self, _: &OperationContext, path: &str, _: OpRead) -> 
Result<Self::Reader> {
+        Ok(oio::PositionReader::new(Hf3fsReader {
+            core: self.core.clone(),
+            path: self.core.path(path)?,
+        })
+        .with_max_buf_size(self.core.read.block_size))
+    }
+
+    fn write(&self, ctx: &OperationContext, path: &str, args: OpWrite) -> 
Result<Self::Writer> {
+        Ok(Hf3fsWriter::new(
+            self.core.clone(),
+            self.core.path(path)?,
+            ctx.executor().clone(),
+            args,
+        ))
+    }
+
+    async fn stat(&self, ctx: &OperationContext, path: &str, args: OpStat) -> 
Result<RpStat> {
+        self.metadata.stat(ctx, path, args).await
+    }
+
+    async fn create_dir(
+        &self,
+        ctx: &OperationContext,
+        path: &str,
+        args: OpCreateDir,
+    ) -> Result<RpCreateDir> {
+        self.metadata.create_dir(ctx, path, args).await
+    }
+
+    fn list(&self, ctx: &OperationContext, path: &str, args: OpList) -> 
Result<Self::Lister> {
+        self.metadata.list(ctx, path, args)
+    }
+
+    fn delete(&self, ctx: &OperationContext) -> Result<Self::Deleter> {
+        self.metadata.delete(ctx)
+    }
+
+    fn copy(&self, _: &OperationContext, _: &str, _: &str, _: OpCopy) -> 
Result<Self::Copier> {
+        Err(Error::new(
+            ErrorKind::Unsupported,
+            "3FS native copy is unsupported",
+        ))
+    }
+
+    async fn presign(&self, _: &OperationContext, _: &str, _: OpPresign) -> 
Result<RpPresign> {
+        Err(Error::new(
+            ErrorKind::Unsupported,
+            "3FS presign is unsupported",
+        ))
+    }
+
+    async fn rename(
+        &self,
+        ctx: &OperationContext,
+        from: &str,
+        to: &str,
+        args: OpRename,
+    ) -> Result<RpRename> {
+        self.metadata.rename(ctx, from, to, args).await
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::ffi::OsStr;
+    use std::os::unix::ffi::OsStrExt;
+    use std::os::unix::fs::symlink;
+
+    use super::*;
+
+    #[test]
+    fn builder_rejects_invalid_config_values() {
+        let dir = tempfile::tempdir().unwrap();
+        let root = dir.path().to_str().unwrap();
+
+        let err = Hf3fsBuilder::default().build().err().unwrap();
+        assert_eq!(err.kind(), ErrorKind::ConfigInvalid);
+
+        let err = Hf3fsBuilder::default()
+            .root("relative/path")
+            .build()
+            .err()
+            .unwrap();
+        assert_eq!(err.kind(), ErrorKind::ConfigInvalid);
+
+        let file = dir.path().join("not-a-dir");
+        std::fs::write(&file, b"data").unwrap();
+        let err = Hf3fsBuilder::default()
+            .root(file.to_str().unwrap())
+            .build()
+            .err()
+            .unwrap();
+        assert_eq!(err.kind(), ErrorKind::ConfigInvalid);
+
+        for builder in [
+            Hf3fsBuilder::default().root(root).queue_depth(0),
+            Hf3fsBuilder::default()
+                .root(root)
+                .queue_depth(i32::MAX as usize),
+            Hf3fsBuilder::default().root(root).block_size(0),
+            Hf3fsBuilder::default()
+                .root(root)
+                .queue_depth(4)
+                .block_size(isize::MAX as usize / 2),
+        ] {
+            let err = builder.build().err().unwrap();
+            assert_eq!(err.kind(), ErrorKind::ConfigInvalid);
+        }
+    }
+
+    #[test]
+    fn builder_rejects_non_utf8_canonical_root() {
+        let dir = tempfile::tempdir().unwrap();
+        let raw_dir = dir.path().join(OsStr::from_bytes(b"dir-\xff"));
+        std::fs::create_dir(&raw_dir).unwrap();
+        let utf8_link = dir.path().join("utf8-link");
+        symlink(&raw_dir, &utf8_link).unwrap();
+
+        let err = Hf3fsBuilder::default()
+            .root(utf8_link.to_str().unwrap())
+            .build()
+            .err()
+            .unwrap();
+        assert_eq!(err.kind(), ErrorKind::ConfigInvalid);
+    }
+
+    #[test]
+    fn config_from_uri_parses_root_and_options() {
+        let uri = OperatorUri::new(
+            "hf3fs:///mnt/3fs/data",
+            [
+                ("queue_depth".to_string(), "16".to_string()),
+                ("block_size".to_string(), "65536".to_string()),
+                (
+                    "library_path".to_string(),
+                    "/opt/3fs/libhf3fs_api_shared.so".to_string(),
+                ),
+            ],
+        )
+        .unwrap();
+        let cfg = Hf3fsConfig::from_uri(&uri).unwrap();
+        assert_eq!(cfg.root.as_deref(), Some("/mnt/3fs/data"));
+        assert_eq!(cfg.queue_depth, Some(16));
+        assert_eq!(cfg.block_size, Some(65536));
+        assert_eq!(
+            cfg.library_path.as_deref(),
+            Some("/opt/3fs/libhf3fs_api_shared.so")
+        );
+    }
+
+    #[test]
+    fn core_path_confines_paths_to_root() {
+        let dir = tempfile::tempdir().unwrap();
+        let api = Api::noop();
+        let (read, _read_rx, _) = IoDriver::for_test(api.clone(), 2, 4096, 
true);
+        let (write, _write_rx, _) = IoDriver::for_test(api.clone(), 2, 4096, 
false);
+        let core = Hf3fsCore {
+            root: dir.path().to_path_buf(),
+            api,
+            read,
+            write,
+        };
+
+        assert_eq!(core.path("").unwrap(), dir.path());
+        assert_eq!(core.path("/").unwrap(), dir.path());
+        assert_eq!(core.path("a/b/c").unwrap(), dir.path().join("a/b/c"));
+        assert_eq!(core.path("a/b/").unwrap(), dir.path().join("a/b"));
+
+        for invalid in ["../escape", "a/../../escape", "/absolute"] {
+            let err = core.path(invalid).unwrap_err();
+            assert_eq!(err.kind(), ErrorKind::NotFound, "path: {invalid}");
+        }
+    }
+}
diff --git a/core/services/hf3fs/src/config.rs 
b/core/services/hf3fs/src/config.rs
new file mode 100644
index 0000000000..1dc55406ed
--- /dev/null
+++ b/core/services/hf3fs/src/config.rs
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use opendal_core::{Configurator, OperatorUri, Result};
+use serde::{Deserialize, Serialize};
+
+use crate::Hf3fs;
+
+/// Configuration for DeepSeek's 3FS (Fire-Flyer File System) USRBIO access on 
Linux.
+#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(default)]
+#[non_exhaustive]
+pub struct Hf3fsConfig {
+    /// Existing absolute directory on a mounted DeepSeek 3FS (Fire-Flyer File 
System) instance. Required.
+    pub root: Option<String>,
+    /// USRBIO shared library path. Defaults to `libhf3fs_api_shared.so`.
+    pub library_path: Option<String>,
+    /// Maximum in-flight requests per read or write ring. Defaults to 32.
+    pub queue_depth: Option<usize>,
+    /// Maximum bytes per request. Defaults to 1 MiB.
+    /// Shared memory usage is approximately `3 * queue_depth * block_size`.
+    pub block_size: Option<usize>,
+}
+
+impl Configurator for Hf3fsConfig {
+    type Builder = Hf3fs;
+
+    fn from_uri(uri: &OperatorUri) -> Result<Self> {
+        let mut options = uri.options().clone();
+        if let Some(root) = uri.root().filter(|v| !v.is_empty()) {
+            options
+                .entry("root".into())
+                .or_insert_with(|| format!("/{root}"));
+        }
+        Self::from_iter(options)
+    }
+
+    fn into_builder(self) -> Self::Builder {
+        Hf3fs { config: self }
+    }
+}
diff --git a/core/services/hf3fs/src/driver.rs 
b/core/services/hf3fs/src/driver.rs
new file mode 100644
index 0000000000..7b95d93027
--- /dev/null
+++ b/core/services/hf3fs/src/driver.rs
@@ -0,0 +1,867 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::ffi::{CStr, CString};
+use std::fs::File;
+use std::os::fd::AsRawFd;
+#[cfg(test)]
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::{Arc, Condvar, Mutex, OnceLock};
+use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
+
+use bytes::Bytes;
+use opendal_core::raw::new_std_io_error;
+use opendal_core::{Buffer, Error, ErrorKind, Result};
+use tokio::sync::{OwnedSemaphorePermit, Semaphore, mpsc, oneshot};
+
+use crate::ffi::{Api, Cqe, Ior, Iov};
+
+pub(crate) struct RegisteredFile {
+    pub file: File,
+    api: Arc<Api>,
+}
+
+impl RegisteredFile {
+    pub fn new(api: Arc<Api>, file: File) -> Result<Arc<Self>> {
+        // Registration borrows the descriptor until deregistration in Drop.
+        let result = unsafe { (api.reg_fd)(file.as_raw_fd(), 0) };
+        // Unlike other USRBIO functions, registration returns positive errno.
+        if result > 0 {
+            return 
Err(new_std_io_error(std::io::Error::from_raw_os_error(result)));
+        }
+        Ok(Arc::new(Self { file, api }))
+    }
+}
+
+impl Drop for RegisteredFile {
+    fn drop(&mut self) {
+        // Every prepared request owns an Arc, including cancelled callers.
+        unsafe { (self.api.dereg_fd)(self.file.as_raw_fd()) };
+    }
+}
+
+struct Slots {
+    free: Vec<usize>,
+    retained: usize,
+}
+
+struct Pool {
+    api: Arc<Api>,
+    iov: Iov,
+    block_size: usize,
+    retain_limit: usize,
+    slots: Mutex<Slots>,
+    available: Condvar,
+    permits: Arc<Semaphore>,
+    #[cfg(test)]
+    waiting_slots: AtomicUsize,
+    #[cfg(test)]
+    _backing: Option<Box<[u8]>>,
+}
+
+// The mapping is stable. Each slot has one owner until I/O completes;
+// completed, retained read slots are immutable until their final owner drops.
+unsafe impl Send for Pool {}
+unsafe impl Sync for Pool {}
+
+impl Pool {
+    fn new(
+        api: Arc<Api>,
+        mount: &CStr,
+        depth: usize,
+        block_size: usize,
+        read: bool,
+    ) -> Result<Arc<Self>> {
+        let count = if read { depth * 2 } else { depth };
+        // Zero is a valid initial state for the C struct, which the API fills.
+        let mut iov = unsafe { std::mem::zeroed() };
+        let result = unsafe {
+            (api.iovcreate)(&mut iov, mount.as_ptr(), count * block_size, 
block_size, -1)
+        };
+        if result < 0 {
+            return 
Err(new_std_io_error(std::io::Error::from_raw_os_error(-result)));
+        }
+        // Unlink the POSIX shared-memory name immediately after registration 
so
+        // crashes or fatal-error quarantine cannot leave orphaned /dev/shm 
files.
+        unsafe { (api.iovunlink)(&mut iov) };
+        Ok(Arc::new(Self {
+            available: Condvar::new(),
+            api,
+            iov,
+            block_size,
+            retain_limit: depth,
+            permits: Arc::new(Semaphore::new(depth)),
+            slots: Mutex::new(Slots {
+                free: (0..count).collect(),
+                retained: 0,
+            }),
+            #[cfg(test)]
+            waiting_slots: AtomicUsize::new(0),
+            #[cfg(test)]
+            _backing: None,
+        }))
+    }
+}
+
+#[cfg(test)]
+impl Pool {
+    fn in_memory(api: Arc<Api>, depth: usize, block_size: usize) -> Arc<Self> {
+        let mut backing = vec![0u8; depth * block_size].into_boxed_slice();
+        let mut iov: Iov = unsafe { std::mem::zeroed() };
+        iov.base = backing.as_mut_ptr();
+        Arc::new(Self {
+            available: Condvar::new(),
+            api,
+            iov,
+            block_size,
+            retain_limit: depth,
+            permits: Arc::new(Semaphore::new(depth)),
+            slots: Mutex::new(Slots {
+                free: (0..depth).collect(),
+                retained: 0,
+            }),
+            #[cfg(test)]
+            waiting_slots: AtomicUsize::new(0),
+            _backing: Some(backing),
+        })
+    }
+}
+
+impl Drop for Pool {
+    fn drop(&mut self) {
+        // No ring, pending request, or returned Bytes can still use this 
mapping.
+        unsafe { (self.api.iovdestroy)(&mut self.iov) };
+    }
+}
+
+struct Slot {
+    pool: Arc<Pool>,
+    index: usize,
+    len: usize,
+    retained: bool,
+    _permit: Option<OwnedSemaphorePermit>,
+}
+
+impl AsRef<[u8]> for Slot {
+    fn as_ref(&self) -> &[u8] {
+        // Only completed reads use this view. A slot never crosses an Iov 
block.
+        unsafe {
+            std::slice::from_raw_parts(
+                self.pool.iov.base.add(self.index * self.pool.block_size),
+                self.len,
+            )
+        }
+    }
+}
+
+impl Slot {
+    fn into_buffer(mut self) -> Buffer {
+        let mut slots = self.pool.slots.lock().unwrap();
+        if slots.retained < self.pool.retain_limit {
+            slots.retained += 1;
+            self.retained = true;
+            drop(slots);
+            Bytes::from_owner(self).into()
+        } else {
+            drop(slots);
+            // Reserve a full ring's worth of slots for progress even when an
+            // application collects a file larger than the shared-memory pool.
+            Bytes::copy_from_slice(self.as_ref()).into()
+        }
+    }
+}
+
+impl Drop for Slot {
+    fn drop(&mut self) {
+        let mut slots = self.pool.slots.lock().unwrap();
+        if self.retained {
+            slots.retained -= 1;
+        }
+        slots.free.push(self.index);
+        drop(slots);
+        self.pool.available.notify_one();
+    }
+}
+
+pub(crate) struct Request {
+    file: Arc<RegisteredFile>,
+    offset: usize,
+    size: usize,
+    slot: Option<Slot>,
+    reply: oneshot::Sender<Result<(usize, Option<Slot>)>>,
+}
+
+#[cfg(test)]
+impl Request {
+    pub(crate) fn is_cancelled(&self) -> bool {
+        self.reply.is_closed()
+    }
+
+    pub(crate) async fn cancelled(&mut self) {
+        self.reply.closed().await;
+    }
+}
+
+struct Pending {
+    request: Request,
+    slot: Slot,
+}
+
+#[derive(Clone)]
+pub(crate) struct IoDriver {
+    inner: Arc<IoDriverInner>,
+    pub block_size: usize,
+}
+
+struct IoDriverInner {
+    tx: Option<mpsc::Sender<Request>>,
+    pool: Arc<Pool>,
+    worker: Option<std::thread::JoinHandle<()>>,
+    read: bool,
+    failure: Arc<OnceLock<String>>,
+}
+
+impl Drop for IoDriverInner {
+    fn drop(&mut self) {
+        // Closing the channel makes an idle worker leave its blocking receive.
+        self.tx.take();
+        // A worker may be waiting for slots retained by caller buffers. Wake 
it
+        // so the closed reply check in its wait predicate can let it exit.
+        drop(self.pool.slots.lock().unwrap());
+        self.pool.available.notify_all();
+        if let Some(worker) = self.worker.take() {
+            // Never join from the worker thread itself.
+            if worker.thread().id() != std::thread::current().id() {
+                let _ = worker.join();
+            }
+        }
+    }
+}
+
+impl IoDriver {
+    pub fn start(
+        api: Arc<Api>,
+        mount: CString,
+        depth: usize,
+        block_size: usize,
+        read: bool,
+    ) -> Result<Self> {
+        let (tx, rx) = mpsc::channel(depth);
+        let (ready_tx, ready_rx) = std::sync::mpsc::sync_channel(1);
+        let failure = Arc::new(OnceLock::new());
+        let worker_failure = failure.clone();
+        let worker = std::thread::Builder::new()
+            .name(if read { "hf3fs-read" } else { "hf3fs-write" }.into())
+            .spawn(move || {
+                match Worker::new(api, &mount, depth, block_size, read, rx, 
worker_failure) {
+                    Ok(mut worker) => {
+                        if ready_tx.send(Ok(worker.pool.clone())).is_ok()
+                            && let Err(error) = worker.run()
+                        {
+                            let _ = worker.failure.set(error.to_string());
+                        }
+                    }
+                    Err(error) => {
+                        let _ = ready_tx.send(Err(error));
+                    }
+                }
+            })
+            .map_err(new_std_io_error)?;
+        let pool = match ready_rx.recv() {
+            Ok(Ok(pool)) => pool,
+            Ok(Err(error)) => {
+                let _ = worker.join();
+                return Err(error);
+            }
+            Err(error) => {
+                let _ = worker.join();
+                return Err(Error::new(
+                    ErrorKind::Unexpected,
+                    "USRBIO driver initialization failed",
+                )
+                .set_source(error));
+            }
+        };
+        Ok(Self {
+            inner: Arc::new(IoDriverInner {
+                tx: Some(tx),
+                pool,
+                worker: Some(worker),
+                read,
+                failure,
+            }),
+            block_size,
+        })
+    }
+
+    fn stopped_error(&self) -> Error {
+        Error::new(
+            ErrorKind::Unexpected,
+            self.inner
+                .failure
+                .get()
+                .map_or("USRBIO driver stopped", String::as_str),
+        )
+    }
+
+    #[cfg(test)]
+    pub(crate) fn for_test(
+        api: Arc<Api>,
+        depth: usize,
+        block_size: usize,
+        read: bool,
+    ) -> (Self, mpsc::Receiver<Request>, Arc<OnceLock<String>>) {
+        let (tx, rx) = mpsc::channel(depth);
+        let failure = Arc::new(OnceLock::new());
+        let pool = Pool::in_memory(api, depth, block_size);
+        (
+            Self {
+                inner: Arc::new(IoDriverInner {
+                    tx: Some(tx),
+                    pool,
+                    worker: None,
+                    read,
+                    failure: failure.clone(),
+                }),
+                block_size,
+            },
+            rx,
+            failure,
+        )
+    }
+
+    pub async fn submit(
+        &self,
+        file: Arc<RegisteredFile>,
+        offset: u64,
+        size: usize,
+        data: Option<Buffer>,
+    ) -> Result<(usize, Buffer)> {
+        if size == 0
+            || size > self.block_size
+            || self.inner.read != data.is_none()
+            || data.as_ref().is_some_and(|buffer| buffer.len() != size)
+        {
+            return Err(Error::new(
+                ErrorKind::Unexpected,
+                "invalid USRBIO buffer size or direction",
+            ));
+        }
+        let offset = usize::try_from(offset).map_err(|e| {
+            Error::new(
+                ErrorKind::RangeNotSatisfied,
+                "file offset exceeds platform limits",
+            )
+            .set_source(e)
+        })?;
+        let (reply, result) = oneshot::channel();
+        let slot = if let Some(data) = data {
+            let pool = &self.inner.pool;
+            let permit = pool
+                .permits
+                .clone()
+                .acquire_owned()
+                .await
+                .map_err(|_| self.stopped_error())?;
+            let index = pool.slots.lock().unwrap().free.pop().expect("write 
slot");
+            let slot = Slot {
+                pool: pool.clone(),
+                index,
+                len: size,
+                retained: false,
+                _permit: Some(permit),
+            };
+            // Copy on the caller's thread before handing the exclusive slot to
+            // the driver, so concurrent writers do not serialize their copies.
+            let dst = unsafe {
+                std::slice::from_raw_parts_mut(pool.iov.base.add(index * 
pool.block_size), size)
+            };
+            let mut offset = 0;
+            for part in data {
+                dst[offset..offset + part.len()].copy_from_slice(&part);
+                offset += part.len();
+            }
+            Some(slot)
+        } else {
+            None
+        };
+        let Some(tx) = self.inner.tx.as_ref() else {
+            return Err(self.stopped_error());
+        };
+        tx.send(Request {
+            file,
+            offset,
+            size,
+            slot,
+            reply,
+        })
+        .await
+        .map_err(|_| self.stopped_error())?;
+        // Read overflow copies run on the caller, leaving the driver free to
+        // submit and reap other requests.
+        let (size, slot) = result.await.map_err(|_| self.stopped_error())??;
+        Ok((size, slot.map_or_else(Buffer::new, Slot::into_buffer)))
+    }
+}
+
+pub(crate) fn ring_entries(depth: usize) -> i32 {
+    // Submission entries retire in order, even when I/O completes out of
+    // order. Leave headroom for delayed entries without raising the I/O limit.
+    // Clamp strictly below i32::MAX because upstream computes `entries + 1` in
+    // signed 32-bit arithmetic.
+    depth
+        .saturating_mul(64)
+        .saturating_add(1)
+        .min((i32::MAX - 1) as usize) as i32
+}
+
+struct Worker {
+    pool: Arc<Pool>,
+    ring: Option<Ior>,
+    read: bool,
+    depth: usize,
+    rx: mpsc::Receiver<Request>,
+    pending: Vec<Option<Pending>>,
+    active: usize,
+    failure: Arc<OnceLock<String>>,
+}
+
+impl Worker {
+    fn new(
+        api: Arc<Api>,
+        mount: &CStr,
+        depth: usize,
+        block_size: usize,
+        read: bool,
+        rx: mpsc::Receiver<Request>,
+        failure: Arc<OnceLock<String>>,
+    ) -> Result<Self> {
+        let pool = Pool::new(api.clone(), mount, depth, block_size, read)?;
+        let mut ring = unsafe { std::mem::zeroed() };
+        let entries = ring_entries(depth);
+        let result = unsafe {
+            (api.iorcreate4)(
+                &mut ring,
+                mount.as_ptr(),
+                entries,
+                read,
+                // Complete requests independently instead of waiting for a 
batch.
+                -1,
+                0,
+                -1,
+                0,
+            )
+        };
+        if result < 0 {
+            return 
Err(new_std_io_error(std::io::Error::from_raw_os_error(-result)));
+        }
+        Ok(Self {
+            pool,
+            ring: Some(ring),
+            read,
+            depth,
+            rx,
+            pending: (0..depth * 2).map(|_| None).collect(),
+            active: 0,
+            failure,
+        })
+    }
+
+    fn prepare(&mut self, mut request: Request) -> Option<Request> {
+        if request.reply.is_closed() {
+            return None;
+        }
+        let slot = if let Some(slot) = request.slot.take() {
+            slot
+        } else {
+            let Some(index) = self.pool.slots.lock().unwrap().free.pop() else {
+                return Some(request);
+            };
+            Slot {
+                pool: self.pool.clone(),
+                index,
+                len: request.size,
+                retained: false,
+                _permit: None,
+            }
+        };
+        let index = slot.index;
+        // The slot is exclusive, and the request fits within one Iov block.
+        let ptr = unsafe { self.pool.iov.base.add(index * 
self.pool.block_size) };
+        let result = unsafe {
+            (self.pool.api.prep_io)(
+                self.ring.as_ref().unwrap(),
+                &self.pool.iov,
+                self.read,
+                ptr.cast(),
+                request.file.file.as_raw_fd(),
+                request.offset,
+                request.size as u64,
+                index as *const _,
+            )
+        };
+        if result == -libc::EAGAIN {
+            request.slot = Some(slot);
+            return Some(request);
+        } else if result < 0 {
+            let _ = request
+                .reply
+                .send(Err(new_std_io_error(std::io::Error::from_raw_os_error(
+                    -result,
+                ))));
+        } else {
+            // A prepared I/O may start before submit_ios; retain all 
resources.
+            self.pending[index] = Some(Pending { request, slot });
+            self.active += 1;
+        }
+        None
+    }
+
+    fn run(&mut self) -> Result<()> {
+        let mut cqes: Vec<Cqe> = (0..self.depth)
+            .map(|_| unsafe { std::mem::zeroed() })
+            .collect();
+        let mut waiting = None;
+        let mut refill_until = Instant::now();
+        loop {
+            let mut prepared = false;
+            // Retry submission after reaping completions, including when 
earlier
+            // requests are still in flight.
+            while self.active < self.depth {
+                let request = if waiting.is_some() {
+                    waiting.take()
+                } else if self.active == 0 {
+                    self.rx.blocking_recv()
+                } else {
+                    self.rx.try_recv().ok()
+                };
+                let Some(request) = request else { break };
+                if request.reply.is_closed() {
+                    continue;
+                }
+                let active_before = self.active;
+                waiting = self.prepare(request);
+                if self.active > active_before {
+                    prepared = true;
+                }
+                if waiting.is_some() {
+                    break;
+                }
+            }
+            if self.active == 0 {
+                let Some(request) = waiting.take() else {
+                    return Ok(());
+                };
+                if request.reply.is_closed() {
+                    continue;
+                }
+                if request.slot.is_none() {
+                    // Callers still copying completed reads can hold all 
slots.
+                    // A closed reply also releases the worker when the driver 
is
+                    // dropping while retained buffers still own every slot.
+                    #[cfg(test)]
+                    self.pool.waiting_slots.fetch_add(1, Ordering::SeqCst);
+                    let slots = self
+                        .pool
+                        .available
+                        .wait_while(self.pool.slots.lock().unwrap(), |slots| {
+                            !request.reply.is_closed() && slots.free.is_empty()
+                        })
+                        .unwrap();
+                    #[cfg(test)]
+                    self.pool.waiting_slots.fetch_sub(1, Ordering::SeqCst);
+                    drop(slots);
+                } else {
+                    std::thread::sleep(Duration::from_millis(1));
+                }
+                waiting = Some(request);
+                continue;
+            }
+            if prepared {
+                let result = unsafe { 
(self.pool.api.submit_ios)(self.ring.as_ref().unwrap()) };
+                if result < 0 {
+                    return 
Err(new_std_io_error(std::io::Error::from_raw_os_error(-result)));
+                }
+            }
+            // Give callers just woken by completions a brief chance to refill 
the queue.
+            let poll = self.read && self.active < self.depth && Instant::now() 
< refill_until;
+            let timeout = if poll || self.active == self.depth {
+                None
+            } else {
+                let deadline = (SystemTime::now() + Duration::from_micros(100))
+                    .duration_since(UNIX_EPOCH)
+                    .unwrap_or_default();
+                Some(libc::timespec {
+                    tv_sec: deadline.as_secs() as _,
+                    tv_nsec: deadline.subsec_nanos() as _,
+                })
+            };
+            let timeout_ptr = timeout.as_ref().map_or(std::ptr::null(), |t| t 
as *const _);
+            let count = unsafe {
+                (self.pool.api.wait_for_ios)(
+                    self.ring.as_ref().unwrap(),
+                    cqes.as_mut_ptr(),
+                    cqes.len() as i32,
+                    i32::from(!poll),
+                    timeout_ptr,
+                )
+            };
+            if poll && count == 0 {
+                std::hint::spin_loop();
+            }
+            if count == -libc::ETIMEDOUT || count == -libc::EINTR {
+                continue;
+            }
+            if count < 0 {
+                return 
Err(new_std_io_error(std::io::Error::from_raw_os_error(-count)));
+            }
+            for cqe in &cqes[..count as usize] {
+                let index = cqe.userdata as usize;
+                let Pending { request, mut slot } =
+                    self.pending[index].take().expect("known USRBIO 
completion");
+                self.active -= 1;
+                let result = if cqe.result < 0 {
+                    Err(new_std_io_error(std::io::Error::from_raw_os_error(
+                        -cqe.result as i32,
+                    )))
+                } else if cqe.result as u64 > request.size as u64 {
+                    Err(Error::new(
+                        ErrorKind::Unexpected,
+                        "USRBIO completion exceeds request size",
+                    ))
+                } else {
+                    let size = cqe.result as usize;
+                    slot.len = size;
+                    let slot = (self.read && size > 0).then_some(slot);
+                    Ok((size, slot))
+                };
+                let _ = request.reply.send(result);
+            }
+            if self.read && count > 0 {
+                refill_until = Instant::now() + Duration::from_micros(20);
+            }
+        }
+    }
+}
+
+impl Drop for Worker {
+    fn drop(&mut self) {
+        self.pool.permits.close();
+        let Some(mut ring) = self.ring.take() else {
+            return;
+        };
+        if self.active == 0 {
+            unsafe { (self.pool.api.iordestroy)(&mut ring) };
+        } else {
+            // USRBIO has no cancellation fence. On a fatal driver error, 
native
+            // I/O may still touch these resources: quarantine them until exit.
+            // Dropping a caller future alone never enters this path.
+            let message = self
+                .failure
+                .get()
+                .map_or("USRBIO driver stopped with pending I/O", 
String::as_str);
+            for pending in self.pending.iter_mut().filter_map(Option::take) {
+                let _ = pending
+                    .request
+                    .reply
+                    .send(Err(Error::new(ErrorKind::Unexpected, message)));
+                std::mem::forget((pending.request.file, pending.slot));
+            }
+            // The ring's native allocation remains live; leaked slots retain
+            // the shared mapping and library needed by the in-flight requests.
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::sync::mpsc::{RecvTimeoutError, channel};
+
+    use super::*;
+
+    fn test_worker(
+        pool: Arc<Pool>,
+        rx: mpsc::Receiver<Request>,
+        depth: usize,
+        read: bool,
+        failure: Arc<OnceLock<String>>,
+    ) -> Worker {
+        Worker {
+            pool,
+            ring: None,
+            read,
+            depth,
+            rx,
+            pending: (0..depth * 2).map(|_| None).collect(),
+            active: 0,
+            failure,
+        }
+    }
+
+    fn test_driver(
+        tx: mpsc::Sender<Request>,
+        pool: Arc<Pool>,
+        worker: Option<std::thread::JoinHandle<()>>,
+        read: bool,
+        block_size: usize,
+        failure: Arc<OnceLock<String>>,
+    ) -> IoDriver {
+        IoDriver {
+            inner: Arc::new(IoDriverInner {
+                tx: Some(tx),
+                pool,
+                worker,
+                read,
+                failure,
+            }),
+            block_size,
+        }
+    }
+
+    #[test]
+    fn ring_entries_stays_below_i32_max() {
+        assert_eq!(ring_entries(1), 65);
+        assert_eq!(ring_entries(32), 2049);
+        assert_eq!(ring_entries(i32::MAX as usize - 1), i32::MAX - 1);
+        assert_eq!(ring_entries(usize::MAX), i32::MAX - 1);
+        assert!(ring_entries(usize::MAX).checked_add(1).is_some());
+    }
+
+    #[test]
+    fn dropping_driver_joins_worker_before_returning() {
+        let api = Api::noop();
+        let (tx, rx) = mpsc::channel(1);
+        let pool = Pool::in_memory(api, 1, 16);
+        let failure = Arc::new(OnceLock::new());
+        let (run_finished_tx, run_finished_rx) = channel();
+        let (allow_exit_tx, allow_exit_rx) = channel::<()>();
+
+        let worker_pool = pool.clone();
+        let worker_failure = failure.clone();
+        let worker = std::thread::spawn(move || {
+            test_worker(worker_pool, rx, 1, true, worker_failure)
+                .run()
+                .unwrap();
+            run_finished_tx.send(()).unwrap();
+            // Keep the thread alive briefly so a drop that does not join would
+            // return before the worker really stops.
+            allow_exit_rx.recv().unwrap();
+        });
+        let driver = test_driver(tx, pool, Some(worker), true, 16, failure);
+
+        let (dropped_tx, dropped_rx) = channel();
+        std::thread::spawn(move || {
+            drop(driver);
+            dropped_tx.send(()).unwrap();
+        });
+
+        run_finished_rx
+            .recv_timeout(Duration::from_secs(5))
+            .expect("worker must stop after the driver closes the channel");
+        assert!(matches!(
+            dropped_rx.recv_timeout(Duration::from_millis(100)),
+            Err(RecvTimeoutError::Timeout)
+        ));
+
+        allow_exit_tx.send(()).unwrap();
+        dropped_rx
+            .recv_timeout(Duration::from_secs(5))
+            .expect("driver drop must join the worker");
+    }
+
+    #[test]
+    fn dropping_driver_unblocks_cancelled_request_waiting_for_retained_slots() 
{
+        let api = Api::noop();
+        let (tx, rx) = mpsc::channel(1);
+        let pool = Pool::in_memory(api.clone(), 1, 16);
+        let failure = Arc::new(OnceLock::new());
+
+        let worker_pool = pool.clone();
+        let worker_failure = failure.clone();
+        let worker = std::thread::spawn(move || {
+            test_worker(worker_pool, rx, 1, true, worker_failure)
+                .run()
+                .unwrap();
+        });
+        let driver = test_driver(tx, pool.clone(), Some(worker), true, 16, 
failure);
+
+        // Model a completed read whose returned Buffer retains the only slot.
+        let index = pool.slots.lock().unwrap().free.pop().unwrap();
+        let retained: Buffer = Slot {
+            pool: pool.clone(),
+            index,
+            len: 16,
+            retained: false,
+            _permit: None,
+        }
+        .into_buffer();
+        assert!(pool.slots.lock().unwrap().free.is_empty());
+
+        let (reply, result) = oneshot::channel();
+        driver
+            .inner
+            .tx
+            .as_ref()
+            .unwrap()
+            .try_send(Request {
+                file: RegisteredFile::new(api, 
tempfile::tempfile().unwrap()).unwrap(),
+                offset: 0,
+                size: 16,
+                slot: None,
+                reply,
+            })
+            .unwrap();
+        let deadline = Instant::now() + Duration::from_secs(5);
+        while pool.waiting_slots.load(Ordering::SeqCst) == 0 {
+            assert!(
+                Instant::now() < deadline,
+                "worker did not wait for slots owned by a retained buffer"
+            );
+            std::thread::yield_now();
+        }
+
+        // Cancel the caller and drop the last driver handle while the worker 
is
+        // waiting for a slot that only the retained Buffer still owns.
+        drop(result);
+        let (dropped_tx, dropped_rx) = channel();
+        std::thread::spawn(move || {
+            drop(driver);
+            dropped_tx.send(()).unwrap();
+        });
+        dropped_rx
+            .recv_timeout(Duration::from_secs(5))
+            .expect("driver drop must not deadlock behind retained slots");
+        assert_eq!(retained.to_vec(), vec![0; 16]);
+    }
+
+    #[tokio::test]
+    async fn stopped_driver_surfaces_shared_fatal_error() {
+        let api = Api::noop();
+        let (driver, rx, failure) = IoDriver::for_test(api.clone(), 2, 4096, 
true);
+        let file = RegisteredFile::new(api, 
tempfile::tempfile().unwrap()).unwrap();
+
+        let _ = failure.set("simulated fatal USRBIO submit error".to_string());
+        drop(rx);
+
+        let err = driver.submit(file, 0, 16, None).await.unwrap_err();
+        assert_eq!(err.kind(), ErrorKind::Unexpected);
+        assert!(
+            err.to_string()
+                .contains("simulated fatal USRBIO submit error")
+        );
+    }
+}
diff --git a/core/services/hf3fs/src/ffi.rs b/core/services/hf3fs/src/ffi.rs
new file mode 100644
index 0000000000..1cbd3c6525
--- /dev/null
+++ b/core/services/hf3fs/src/ffi.rs
@@ -0,0 +1,237 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Minimal bindings to the public `hf3fs_usrbio.h` ABI.
+//! 
<https://github.com/deepseek-ai/3FS/blob/22fca04564c7cc230fd8b9523b8b92864e1dad47/src/lib/api/hf3fs_usrbio.h>
+
+use std::collections::HashMap;
+use std::ffi::{CStr, c_char, c_int, c_void};
+use std::path::{Path, PathBuf};
+use std::sync::{Arc, Mutex, OnceLock};
+
+use libloading::Library;
+use opendal_core::{Error, ErrorKind, Result};
+
+#[repr(C)]
+pub(crate) struct Iov {
+    pub base: *mut u8,
+    handle: *mut c_void,
+    id: [c_char; 16],
+    mount_point: [c_char; 256],
+    size: usize,
+    block_size: usize,
+    numa: c_int,
+}
+
+#[repr(C)]
+pub(crate) struct Ior {
+    iov: Iov,
+    handle: *mut c_void,
+    mount_point: [c_char; 256],
+    for_read: bool,
+    io_depth: c_int,
+    priority: c_int,
+    timeout: c_int,
+    flags: u64,
+}
+
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub(crate) struct Cqe {
+    pub index: i32,
+    reserved: i32,
+    pub result: i64,
+    pub userdata: *const c_void,
+}
+
+pub(crate) struct Api {
+    pub extract_mount_point: unsafe extern "C" fn(*mut c_char, c_int, *const 
c_char) -> c_int,
+    pub iovcreate: unsafe extern "C" fn(*mut Iov, *const c_char, usize, usize, 
c_int) -> c_int,
+    pub iovunlink: unsafe extern "C" fn(*mut Iov),
+    pub iovdestroy: unsafe extern "C" fn(*mut Iov),
+    pub iorcreate4: unsafe extern "C" fn(
+        *mut Ior,
+        *const c_char,
+        c_int,
+        bool,
+        c_int,
+        c_int,
+        c_int,
+        u64,
+    ) -> c_int,
+    pub iordestroy: unsafe extern "C" fn(*mut Ior),
+    pub reg_fd: unsafe extern "C" fn(c_int, u64) -> c_int,
+    pub dereg_fd: unsafe extern "C" fn(c_int),
+    pub prep_io: unsafe extern "C" fn(
+        *const Ior,
+        *const Iov,
+        bool,
+        *mut c_void,
+        c_int,
+        usize,
+        u64,
+        *const c_void,
+    ) -> c_int,
+    pub submit_ios: unsafe extern "C" fn(*const Ior) -> c_int,
+    pub wait_for_ios:
+        unsafe extern "C" fn(*const Ior, *mut Cqe, c_int, c_int, *const 
libc::timespec) -> c_int,
+    #[cfg(not(test))]
+    _library: Library,
+    #[cfg(test)]
+    _library: Option<Library>,
+}
+
+static LOADED_APIS: OnceLock<Mutex<HashMap<PathBuf, Arc<Api>>>> = 
OnceLock::new();
+
+impl Api {
+    pub fn load(path: &Path) -> Result<Arc<Self>> {
+        let key = path.canonicalize().unwrap_or_else(|_| path.to_path_buf());
+        let cache = LOADED_APIS.get_or_init(|| Mutex::new(HashMap::new()));
+        let mut cache = cache.lock().unwrap_or_else(|e| e.into_inner());
+        if let Some(api) = cache.get(&key) {
+            return Ok(api.clone());
+        }
+
+        // Pin the native DSO for the process lifetime because libhf3fs 
registers
+        // process-global Folly logger factories and FD tables on load.
+        let load = || unsafe {
+            let library = libloading::os::unix::Library::open(
+                Some(path),
+                libc::RTLD_NOW | libc::RTLD_LOCAL | libc::RTLD_NODELETE,
+            )?;
+            let library = Library::from(library);
+            Ok::<_, libloading::Error>(Self {
+                extract_mount_point: 
*library.get(b"hf3fs_extract_mount_point\0")?,
+                iovcreate: *library.get(b"hf3fs_iovcreate\0")?,
+                iovunlink: *library.get(b"hf3fs_iovunlink\0")?,
+                iovdestroy: *library.get(b"hf3fs_iovdestroy\0")?,
+                iorcreate4: *library.get(b"hf3fs_iorcreate4\0")?,
+                iordestroy: *library.get(b"hf3fs_iordestroy\0")?,
+                reg_fd: *library.get(b"hf3fs_reg_fd\0")?,
+                dereg_fd: *library.get(b"hf3fs_dereg_fd\0")?,
+                prep_io: *library.get(b"hf3fs_prep_io\0")?,
+                submit_ios: *library.get(b"hf3fs_submit_ios\0")?,
+                wait_for_ios: *library.get(b"hf3fs_wait_for_ios\0")?,
+                #[cfg(not(test))]
+                _library: library,
+                #[cfg(test)]
+                _library: Some(library),
+            })
+        };
+        let api = load().map(Arc::new).map_err(|e| {
+            Error::new(
+                ErrorKind::ConfigInvalid,
+                "failed to load 3FS USRBIO library",
+            )
+            .set_source(e)
+        })?;
+        cache.insert(key, api.clone());
+        Ok(api)
+    }
+
+    #[cfg(test)]
+    pub fn noop() -> Arc<Self> {
+        unsafe extern "C" fn extract_mount_point(
+            _: *mut c_char,
+            _: c_int,
+            _: *const c_char,
+        ) -> c_int {
+            -1
+        }
+        unsafe extern "C" fn iovcreate(
+            _: *mut Iov,
+            _: *const c_char,
+            _: usize,
+            _: usize,
+            _: c_int,
+        ) -> c_int {
+            -libc::ENOSYS
+        }
+        unsafe extern "C" fn iovunlink(_: *mut Iov) {}
+        unsafe extern "C" fn iovdestroy(_: *mut Iov) {}
+        unsafe extern "C" fn iorcreate4(
+            _: *mut Ior,
+            _: *const c_char,
+            _: c_int,
+            _: bool,
+            _: c_int,
+            _: c_int,
+            _: c_int,
+            _: u64,
+        ) -> c_int {
+            -libc::ENOSYS
+        }
+        unsafe extern "C" fn iordestroy(_: *mut Ior) {}
+        unsafe extern "C" fn reg_fd(_: c_int, _: u64) -> c_int {
+            0
+        }
+        unsafe extern "C" fn dereg_fd(_: c_int) {}
+        unsafe extern "C" fn prep_io(
+            _: *const Ior,
+            _: *const Iov,
+            _: bool,
+            _: *mut c_void,
+            _: c_int,
+            _: usize,
+            _: u64,
+            _: *const c_void,
+        ) -> c_int {
+            -libc::ENOSYS
+        }
+        unsafe extern "C" fn submit_ios(_: *const Ior) -> c_int {
+            -libc::ENOSYS
+        }
+        unsafe extern "C" fn wait_for_ios(
+            _: *const Ior,
+            _: *mut Cqe,
+            _: c_int,
+            _: c_int,
+            _: *const libc::timespec,
+        ) -> c_int {
+            -libc::ENOSYS
+        }
+
+        Arc::new(Self {
+            extract_mount_point,
+            iovcreate,
+            iovunlink,
+            iovdestroy,
+            iorcreate4,
+            iordestroy,
+            reg_fd,
+            dereg_fd,
+            prep_io,
+            submit_ios,
+            wait_for_ios,
+            _library: None,
+        })
+    }
+
+    pub fn mount_point(&self, root: &CStr) -> Result<std::ffi::CString> {
+        let mut mount = [0; 256];
+        // Both strings are bounded and the root is NUL terminated.
+        let n = unsafe { (self.extract_mount_point)(mount.as_mut_ptr(), 256, 
root.as_ptr()) };
+        if n <= 0 || n > 256 {
+            return Err(Error::new(
+                ErrorKind::ConfigInvalid,
+                "root is not on a supported 3FS mount",
+            ));
+        }
+        // The API includes the terminating NUL in its return value.
+        Ok(unsafe { CStr::from_ptr(mount.as_ptr()) }.to_owned())
+    }
+}
diff --git a/core/services/hf3fs/src/lib.rs b/core/services/hf3fs/src/lib.rs
new file mode 100644
index 0000000000..a16dd1fd9f
--- /dev/null
+++ b/core/services/hf3fs/src/lib.rs
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#![doc = include_str!("../README.md")]
+#![cfg(target_os = "linux")]
+#![deny(missing_docs)]
+
+mod backend;
+mod config;
+mod driver;
+mod ffi;
+mod reader;
+mod writer;
+
+pub use backend::Hf3fsBuilder as Hf3fs;
+pub use config::Hf3fsConfig;
+
+/// URI scheme for the DeepSeek 3FS (Fire-Flyer File System) USRBIO service.
+pub const HF3FS_SCHEME: &str = "hf3fs";
+
+/// Register DeepSeek 3FS (Fire-Flyer File System) for
+/// [`opendal_core::Operator::from_uri`] and 
[`opendal_core::Operator::via_iter`].
+pub fn register_hf3fs_service(registry: &opendal_core::OperatorRegistry) {
+    registry.register::<Hf3fs>(HF3FS_SCHEME);
+}
diff --git a/core/services/hf3fs/src/reader.rs 
b/core/services/hf3fs/src/reader.rs
new file mode 100644
index 0000000000..d79d29929c
--- /dev/null
+++ b/core/services/hf3fs/src/reader.rs
@@ -0,0 +1,69 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::path::PathBuf;
+use std::sync::Arc;
+
+use opendal_core::raw::*;
+use opendal_core::{Buffer, Result};
+
+use crate::backend::Hf3fsCore;
+use crate::driver::{IoDriver, RegisteredFile};
+
+pub(crate) struct Hf3fsReader {
+    pub core: Arc<Hf3fsCore>,
+    pub path: PathBuf,
+}
+
+pub(crate) struct Hf3fsReadHandle {
+    file: Arc<RegisteredFile>,
+    driver: IoDriver,
+}
+
+impl oio::PositionRead for Hf3fsReader {
+    type Handle = Hf3fsReadHandle;
+
+    async fn open(&self) -> Result<Self::Handle> {
+        let api = self.core.api.clone();
+        let path = self.path.clone();
+        let file = tokio::task::spawn_blocking(move || {
+            RegisteredFile::new(api, 
std::fs::File::open(path).map_err(new_std_io_error)?)
+        })
+        .await
+        .map_err(new_task_join_error)??;
+        Ok(Hf3fsReadHandle {
+            file,
+            driver: self.core.read.clone(),
+        })
+    }
+
+    async fn read_at(handle: &Self::Handle, offset: u64, size: usize) -> 
Result<Buffer> {
+        if size == 0 {
+            return Ok(Buffer::new());
+        }
+        let (_, buffer) = handle
+            .driver
+            .submit(
+                handle.file.clone(),
+                offset,
+                size.min(handle.driver.block_size),
+                None,
+            )
+            .await?;
+        Ok(buffer)
+    }
+}
diff --git a/core/services/hf3fs/src/writer.rs 
b/core/services/hf3fs/src/writer.rs
new file mode 100644
index 0000000000..f3c82c5918
--- /dev/null
+++ b/core/services/hf3fs/src/writer.rs
@@ -0,0 +1,237 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::path::PathBuf;
+use std::sync::Arc;
+
+use bytes::Buf;
+use opendal_core::raw::*;
+use opendal_core::*;
+
+use crate::backend::Hf3fsCore;
+use crate::driver::{IoDriver, RegisteredFile};
+
+pub(crate) struct Hf3fsWriter {
+    core: Arc<Hf3fsCore>,
+    path: PathBuf,
+    executor: Executor,
+    options: OpWrite,
+    inner: Option<oio::PositionWriter<Hf3fsWriteHandle>>,
+}
+
+impl Hf3fsWriter {
+    pub fn new(core: Arc<Hf3fsCore>, path: PathBuf, executor: Executor, 
options: OpWrite) -> Self {
+        Self {
+            core,
+            path,
+            executor,
+            options,
+            inner: None,
+        }
+    }
+
+    async fn inner(&mut self) -> Result<&mut 
oio::PositionWriter<Hf3fsWriteHandle>> {
+        if self.inner.is_none() {
+            let path = self.path.clone();
+            let api = self.core.api.clone();
+            let exclusive = self.options.if_not_exists();
+            let file = tokio::task::spawn_blocking(move || {
+                if let Some(parent) = path.parent() {
+                    std::fs::create_dir_all(parent).map_err(new_std_io_error)?;
+                }
+                let file = std::fs::OpenOptions::new()
+                    .write(true)
+                    .create(true)
+                    .create_new(exclusive)
+                    .truncate(true)
+                    .open(path)
+                    .map_err(|e| {
+                        if exclusive && e.kind() == 
std::io::ErrorKind::AlreadyExists {
+                            Error::new(ErrorKind::ConditionNotMatch, "file 
already exists")
+                                .set_source(e)
+                        } else {
+                            new_std_io_error(e)
+                        }
+                    })?;
+                RegisteredFile::new(api, file)
+            })
+            .await
+            .map_err(new_task_join_error)??;
+            self.inner = Some(oio::PositionWriter::new(
+                self.executor.clone(),
+                Hf3fsWriteHandle {
+                    file,
+                    driver: self.core.write.clone(),
+                },
+                self.options.concurrent(),
+            ));
+        }
+        Ok(self.inner.as_mut().expect("writer initialized"))
+    }
+}
+
+impl oio::Write for Hf3fsWriter {
+    async fn write(&mut self, buffer: Buffer) -> Result<()> {
+        self.inner().await?.write(buffer).await
+    }
+
+    async fn close(&mut self) -> Result<Metadata> {
+        self.inner().await?.close().await
+    }
+
+    async fn abort(&mut self) -> Result<()> {
+        if let Some(inner) = self.inner.as_mut() {
+            inner.abort().await?;
+        }
+        Ok(())
+    }
+}
+
+struct Hf3fsWriteHandle {
+    file: Arc<RegisteredFile>,
+    driver: IoDriver,
+}
+
+impl oio::PositionWrite for Hf3fsWriteHandle {
+    async fn write_all_at(&self, mut offset: u64, mut buffer: Buffer) -> 
Result<()> {
+        while !buffer.is_empty() {
+            let size = buffer.len().min(self.driver.block_size);
+            let (written, _) = self
+                .driver
+                .submit(self.file.clone(), offset, size, 
Some(buffer.slice(..size)))
+                .await?;
+            if written == 0 {
+                return 
Err(new_std_io_error(std::io::ErrorKind::WriteZero.into()));
+            }
+            offset += written as u64;
+            buffer.advance(written);
+        }
+        Ok(())
+    }
+
+    async fn close(&self, _: u64) -> Result<Metadata> {
+        let file = self.file.clone();
+        tokio::task::spawn_blocking(move || {
+            file.file.sync_all().map_err(new_std_io_error)?;
+            let stat = file.file.metadata().map_err(new_std_io_error)?;
+            let mut metadata = MetadataBuilder::file(stat.len());
+            metadata.last_modified(Timestamp::try_from(
+                stat.modified().map_err(new_std_io_error)?,
+            )?);
+            Ok(metadata.build())
+        })
+        .await
+        .map_err(new_task_join_error)?
+    }
+
+    async fn abort(&self) -> Result<()> {
+        Err(Error::new(
+            ErrorKind::Unsupported,
+            "3FS writes cannot be rolled back",
+        ))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::time::Duration;
+
+    use oio::Write;
+    use opendal_executor_tokio::TokioExecutor;
+
+    use super::*;
+    use crate::ffi::Api;
+
+    #[tokio::test]
+    async fn unopened_writer_abort_succeeds_without_creating_file() {
+        let dir = tempfile::tempdir().unwrap();
+        let api = Api::noop();
+        let (read, _read_rx, _) = IoDriver::for_test(api.clone(), 2, 4096, 
true);
+        let (write, _write_rx, _) = IoDriver::for_test(api.clone(), 2, 4096, 
false);
+        let core = Arc::new(Hf3fsCore {
+            root: dir.path().to_path_buf(),
+            api,
+            read,
+            write,
+        });
+
+        let target = dir.path().join("unopened/file");
+        let mut writer = Hf3fsWriter::new(
+            core,
+            target.clone(),
+            Executor::with(TokioExecutor::default()),
+            OpWrite::new(),
+        );
+        writer.abort().await.unwrap();
+        assert!(!target.exists());
+    }
+
+    #[tokio::test]
+    async fn 
opened_writer_abort_clears_buffer_cancels_tasks_and_reports_unsupported() {
+        let dir = tempfile::tempdir().unwrap();
+        let api = Api::noop();
+        let (read, _read_rx, _) = IoDriver::for_test(api.clone(), 2, 4096, 
true);
+        let (write, mut write_rx, _) = IoDriver::for_test(api.clone(), 2, 
4096, false);
+        let core = Arc::new(Hf3fsCore {
+            root: dir.path().to_path_buf(),
+            api,
+            read,
+            write,
+        });
+
+        let (options, _) = OpWrite::from_options(
+            &Capability::default(),
+            options::WriteOptions {
+                concurrent: 2,
+                ..Default::default()
+            },
+        )
+        .unwrap();
+        let target = dir.path().join("opened/file");
+        let mut writer = Hf3fsWriter::new(
+            core,
+            target.clone(),
+            Executor::with(TokioExecutor::default()),
+            options,
+        );
+
+        // First write stays cached in PositionWriter; second write spawns an
+        // async task for the first chunk and caches the second chunk.
+        writer.write(Buffer::from("first")).await.unwrap();
+        writer.write(Buffer::from("second")).await.unwrap();
+
+        let mut pending_req = tokio::time::timeout(Duration::from_secs(5), 
write_rx.recv())
+            .await
+            .expect("first write should reach driver")
+            .expect("driver channel open");
+        assert!(!pending_req.is_cancelled());
+
+        let err = writer.abort().await.unwrap_err();
+        assert_eq!(err.kind(), ErrorKind::Unsupported);
+
+        // PositionWriter::abort() cancels its concurrent tasks and clears its
+        // buffered chunk even though native rollback returns Unsupported.
+        tokio::time::timeout(Duration::from_secs(5), pending_req.cancelled())
+            .await
+            .expect("in-flight concurrent write task should be cancelled on 
abort");
+
+        // Closing after abort must not submit the cleared buffered chunk.
+        writer.close().await.unwrap();
+        assert!(write_rx.try_recv().is_err());
+        assert_eq!(std::fs::read(&target).unwrap(), b"");
+    }
+}
diff --git a/core/services/hf3fs/tests/real_service.rs 
b/core/services/hf3fs/tests/real_service.rs
new file mode 100644
index 0000000000..2a29dfe392
--- /dev/null
+++ b/core/services/hf3fs/tests/real_service.rs
@@ -0,0 +1,251 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#![cfg(target_os = "linux")]
+
+use std::time::Duration;
+
+use futures::TryStreamExt;
+use opendal_core::{ErrorKind, Executor, Operator};
+use opendal_executor_tokio::TokioExecutor;
+use opendal_service_hf3fs::Hf3fs;
+
+fn fixture(block_size: usize) -> (tempfile::TempDir, Operator) {
+    let root = std::env::var("OPENDAL_HF3FS_ROOT")
+        .expect("set OPENDAL_HF3FS_ROOT to a real 3FS test directory");
+    let dir = tempfile::tempdir_in(root).unwrap();
+    let mut builder = Hf3fs::default()
+        .root(dir.path().to_str().unwrap())
+        .queue_depth(2)
+        .block_size(block_size);
+    if let Ok(library) = std::env::var("OPENDAL_HF3FS_LIBRARY_PATH") {
+        builder = builder.library_path(&library);
+    }
+    let op = Operator::new(builder).unwrap();
+    let context = op
+        .context()
+        .with_executor(Executor::with(TokioExecutor::default()));
+    (dir, op.with_context(context))
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn read_write_ranges_and_metadata() {
+    let (dir, op) = fixture(4096);
+    let data: Vec<u8> = (0..131_137).map(|i| (i % 251) as u8).collect();
+    op.write("nested/data", data.clone()).await.unwrap();
+    assert_eq!(std::fs::read(dir.path().join("nested/data")).unwrap(), data);
+    assert_eq!(
+        op.stat("nested/data").await.unwrap().content_length(),
+        data.len() as u64
+    );
+
+    // Retain more than the entire shared-memory pool without stalling 
progress.
+    let buffer = tokio::time::timeout(Duration::from_secs(10), 
op.read("nested/data"))
+        .await
+        .unwrap()
+        .unwrap();
+    assert_eq!(buffer.to_vec(), data);
+    let mut stream = op
+        .reader("nested/data")
+        .await
+        .unwrap()
+        .into_stream(..)
+        .await
+        .unwrap();
+    let mut streamed = Vec::new();
+    tokio::time::timeout(Duration::from_secs(10), async {
+        while let Some(buffer) = stream.try_next().await.unwrap() {
+            streamed.extend(buffer.to_vec());
+        }
+    })
+    .await
+    .unwrap();
+    assert_eq!(streamed, data);
+    assert_eq!(
+        op.read_with("nested/data")
+            .range(17..9001)
+            .await
+            .unwrap()
+            .to_vec(),
+        data[17..9001]
+    );
+    assert_eq!(
+        op.read_with("nested/data")
+            .range(131_130..)
+            .await
+            .unwrap()
+            .to_vec(),
+        data[131_130..]
+    );
+
+    op.rename("nested/data", "nested/renamed").await.unwrap();
+    assert!(
+        op.list("nested/")
+            .await
+            .unwrap()
+            .iter()
+            .any(|e| e.path() == "nested/renamed")
+    );
+    op.delete("nested/renamed").await.unwrap();
+    op.delete("nested/renamed").await.unwrap();
+    assert_eq!(
+        op.stat("nested/renamed").await.unwrap_err().kind(),
+        ErrorKind::NotFound
+    );
+    assert_eq!(buffer.to_vec(), data);
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn retained_buffers_survive_reuse_and_operator_drop() {
+    let (dir, op) = fixture(4096);
+    std::fs::write(dir.path().join("data"), vec![0x31; 4096]).unwrap();
+    let first = op.read("data").await.unwrap();
+    let clone = first.clone();
+    let second = op.read("data").await.unwrap();
+    for byte in 0..16u8 {
+        op.write("data", vec![byte; 4096]).await.unwrap();
+        assert_eq!(op.read("data").await.unwrap().to_vec(), vec![byte; 4096]);
+    }
+    drop(first);
+    drop(op);
+    assert_eq!(clone.to_vec(), vec![0x31; 4096]);
+    assert_eq!(second.to_vec(), vec![0x31; 4096]);
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn concurrent_reads_and_cancelled_callers() {
+    let (dir, op) = fixture(4096);
+    let data: Vec<u8> = (0..65_537).map(|i| (i % 251) as u8).collect();
+    std::fs::write(dir.path().join("data"), &data).unwrap();
+    let reader = op.reader("data").await.unwrap();
+    let mut tasks = tokio::task::JoinSet::new();
+    for i in 0..64 {
+        let reader = reader.clone();
+        let task = tasks.spawn(async move { reader.read(0..65_537).await });
+        if i % 2 == 0 {
+            tokio::task::yield_now().await;
+            task.abort();
+        }
+    }
+    tokio::time::timeout(Duration::from_secs(20), async {
+        while let Some(result) = tasks.join_next().await {
+            match result {
+                Ok(result) => assert_eq!(result.unwrap().to_vec(), data),
+                Err(error) => assert!(error.is_cancelled()),
+            }
+        }
+    })
+    .await
+    .unwrap();
+    assert_eq!(op.read("data").await.unwrap().to_vec(), data);
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn overwrite_empty_and_exclusive_writes() {
+    let (dir, op) = fixture(4096);
+    op.write("data", vec![0x41; 9000]).await.unwrap();
+    let err = op
+        .write_with("data", "replacement")
+        .if_not_exists(true)
+        .await
+        .unwrap_err();
+    assert_eq!(err.kind(), ErrorKind::ConditionNotMatch);
+    assert_eq!(op.read("data").await.unwrap().len(), 9000);
+    op.write("data", "short").await.unwrap();
+    assert_eq!(std::fs::read(dir.path().join("data")).unwrap(), b"short");
+    op.write("data", "").await.unwrap();
+    assert_eq!(op.stat("data").await.unwrap().content_length(), 0);
+    assert!(op.read("data").await.unwrap().is_empty());
+    op.create_dir("empty/").await.unwrap();
+    assert!(op.stat("empty/").await.unwrap().is_dir());
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn concurrent_streaming_writes() {
+    let (dir, op) = fixture(4096);
+    let mut writer = op
+        .writer_with("data")
+        .concurrent(4)
+        .chunk(4096)
+        .await
+        .unwrap();
+    for byte in 0..32u8 {
+        writer.write(vec![byte; 4096]).await.unwrap();
+    }
+    writer.close().await.unwrap();
+    let expected: Vec<u8> = (0..32u8).flat_map(|byte| vec![byte; 
4096]).collect();
+    assert_eq!(std::fs::read(dir.path().join("data")).unwrap(), expected);
+    assert_eq!(op.read("data").await.unwrap().to_vec(), expected);
+}
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
+#[ignore = "requires a real 3FS mount and USRBIO library"]
+async fn concurrent_writes_and_cancelled_callers() {
+    let (dir, op) = fixture(1024 * 1024);
+    let mut tasks = tokio::task::JoinSet::new();
+    let barrier = std::sync::Arc::new(tokio::sync::Barrier::new(33));
+    let mut cancelled = Vec::new();
+    for i in 0..32 {
+        let op = op.clone();
+        let barrier = barrier.clone();
+        let task = tasks.spawn(async move {
+            let path = format!("concurrent/{i}");
+            let data: Vec<u8> = (0..2 * 1024 * 1024 + 137)
+                .map(|j| ((i + j) % 251) as u8)
+                .collect();
+            barrier.wait().await;
+            op.write_with(&path, data.clone())
+                .chunk(1024 * 1024)
+                .concurrent(4)
+                .await
+                .unwrap();
+            (path, data)
+        });
+        if i % 2 == 0 {
+            cancelled.push(task);
+        }
+    }
+    barrier.wait().await;
+    tokio::time::sleep(Duration::from_millis(10)).await;
+    for task in cancelled {
+        task.abort();
+    }
+    tokio::time::timeout(Duration::from_secs(30), async {
+        while let Some(result) = tasks.join_next().await {
+            match result {
+                Ok((path, data)) => {
+                    assert_eq!(std::fs::read(dir.path().join(path)).unwrap(), 
data);
+                }
+                Err(error) => assert!(error.is_cancelled()),
+            }
+        }
+        op.write("after-cancellation", vec![0x73; 65_537])
+            .await
+            .unwrap();
+        assert_eq!(
+            op.read("after-cancellation").await.unwrap().to_vec(),
+            vec![0x73; 65_537]
+        );
+    })
+    .await
+    .unwrap();
+}
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 294ebcf45e..ee15190397 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -208,6 +208,9 @@ fn init_default_registry_inner(registry: &OperatorRegistry) 
{
     #[cfg(feature = "services-hf")]
     opendal_service_hf::register_hf_service(registry);
 
+    #[cfg(all(feature = "services-hf3fs", target_os = "linux"))]
+    opendal_service_hf3fs::register_hf3fs_service(registry);
+
     #[cfg(feature = "services-ipfs")]
     opendal_service_ipfs::register_ipfs_service(registry);
 
@@ -394,6 +397,8 @@ pub mod services {
     pub use opendal_service_hdfs_native::*;
     #[cfg(feature = "services-hf")]
     pub use opendal_service_hf::*;
+    #[cfg(all(feature = "services-hf3fs", target_os = "linux"))]
+    pub use opendal_service_hf3fs::*;
     #[cfg(feature = "services-http")]
     pub use opendal_service_http::*;
     #[cfg(feature = "services-ipfs")]
diff --git a/dev/src/generate/docs.rs b/dev/src/generate/docs.rs
index f175b5453b..b1a6611b27 100644
--- a/dev/src/generate/docs.rs
+++ b/dev/src/generate/docs.rs
@@ -203,7 +203,7 @@ pub fn generate(workspace_dir: PathBuf, services: Services) 
-> Result<()> {
         let mut examples = Vec::new();
         for (binding, support) in BINDINGS.iter().zip(support.iter()) {
             let enabled = match support {
-                None => binding.id != "go" || scheme != "smb",
+                None => binding.id != "go" || !matches!(scheme.as_str(), 
"hf3fs" | "smb"),
                 Some(set) => set.contains(&scheme),
             };
             if !enabled {
diff --git a/dev/src/generate/dotnet.rs b/dev/src/generate/dotnet.rs
index d8b6084481..0700e43395 100644
--- a/dev/src/generate/dotnet.rs
+++ b/dev/src/generate/dotnet.rs
@@ -900,7 +900,7 @@ fn capability_refs(lines: &[String]) -> Vec<String> {
 fn enabled_service(srv: &str) -> bool {
     match srv {
         // not enabled in bindings/dotnet/Cargo.toml
-        "foundationdb" | "foyer" | "ftp" | "git" | "hdfs" | "rocksdb" | "smb" 
=> false,
+        "foundationdb" | "foyer" | "ftp" | "git" | "hdfs" | "hf3fs" | 
"rocksdb" | "smb" => false,
         _ => true,
     }
 }
diff --git a/dev/src/generate/java.rs b/dev/src/generate/java.rs
index da8c77e8bd..c18e3aa1e6 100644
--- a/dev/src/generate/java.rs
+++ b/dev/src/generate/java.rs
@@ -93,7 +93,7 @@ struct CapabilityField {
 fn enabled_service(srv: &str) -> bool {
     match srv {
         // not enabled in bindings/java/Cargo.toml
-        "foundationdb" | "ftp" | "git" | "hdfs" | "rocksdb" | "smb" | "tikv" 
=> false,
+        "foundationdb" | "ftp" | "git" | "hdfs" | "hf3fs" | "rocksdb" | "smb" 
| "tikv" => false,
         _ => true,
     }
 }
diff --git a/website/data/capabilities.json b/website/data/capabilities.json
index 16ab27226a..c249702423 100644
--- a/website/data/capabilities.json
+++ b/website/data/capabilities.json
@@ -1410,6 +1410,24 @@
         }
       }
     },
+    {
+      "name": "hf3fs",
+      "scheme": "hf3fs",
+      "native": {
+        "create_dir": true,
+        "delete": true,
+        "delete_with_recursive": true,
+        "list": true,
+        "read": true,
+        "rename": true,
+        "shared": true,
+        "stat": true,
+        "write": true,
+        "write_can_empty": true,
+        "write_can_multi": true,
+        "write_with_if_not_exists": true
+      }
+    },
     {
       "name": "http",
       "scheme": "http",
diff --git a/website/data/services.json b/website/data/services.json
index e3324e1e0d..0da4f9758c 100644
--- a/website/data/services.json
+++ b/website/data/services.json
@@ -2447,6 +2447,51 @@
         }
       ]
     },
+    {
+      "name": "hf3fs",
+      "scheme": "hf3fs",
+      "groups": [
+        "General"
+      ],
+      "configs": [
+        {
+          "name": "root",
+          "type": "string",
+          "required": false,
+          "group": "General",
+          "comments": "Existing absolute directory on a mounted DeepSeek 3FS 
(Fire-Flyer File System) instance. Required."
+        },
+        {
+          "name": "library_path",
+          "type": "string",
+          "required": false,
+          "group": "General",
+          "comments": "USRBIO shared library path. Defaults to 
`libhf3fs_api_shared.so`."
+        },
+        {
+          "name": "queue_depth",
+          "type": "integer",
+          "required": false,
+          "group": "General",
+          "comments": "Maximum in-flight requests per read or write ring. 
Defaults to 32."
+        },
+        {
+          "name": "block_size",
+          "type": "integer",
+          "required": false,
+          "group": "General",
+          "comments": "Maximum bytes per request. Defaults to 1 MiB.\nShared 
memory usage is approximately `3 * queue_depth * block_size`."
+        }
+      ],
+      "examples": [
+        {
+          "binding": "rust",
+          "language": "rust",
+          "minimal": "use opendal::Operator;\n\nlet operator = 
Operator::via_iter(\"hf3fs\", [\n])?;",
+          "full": "use opendal::Operator;\n\nlet operator = 
Operator::via_iter(\"hf3fs\", [\n    // Existing absolute directory on a 
mounted DeepSeek 3FS (Fire-Flyer File System) instance. Required.\n    // 
(\"root\".to_string(), \"...\".to_string()),\n\n    // USRBIO shared library 
path. Defaults to `libhf3fs_api_shared.so`.\n    // 
(\"library_path\".to_string(), \"...\".to_string()),\n\n    // Maximum 
in-flight requests per read or write ring. Defaults to 32.\n    // 
(\"queue_depth\".t [...]
+        }
+      ]
+    },
     {
       "name": "http",
       "scheme": "http",

Reply via email to