Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,42 @@ jobs:
timeout-minutes: 15
run: FUSER_FEATURES=macos-nfs ./tests/macos_bench.sh

# The same backend with NFSv4.1
- name: Mount tests (NFSv4.1)
timeout-minutes: 10
run: FUSER_FEATURES=macos-nfs FUSER_MOUNT_OPTION=vers=4.1 cargo run -p fuser-tests -- macos-mount

- name: pjdfs tests (NFSv4.1)
timeout-minutes: 30
run: FUSER_FEATURES=macos-nfs FUSER_MOUNT_OPTION=vers=4.1 ./tests/macos_pjdfs.sh

- name: Benchmark (NFSv4.1)
continue-on-error: true
timeout-minutes: 15
run: FUSER_FEATURES=macos-nfs FUSER_MOUNT_OPTION=vers=4.1 ./tests/macos_bench.sh

# Experimental, last as they leave /etc/fuse.conf allowing other users: the pjdfstest
# cases the runs above exclude, as root, as most switch users. The job summary lists
# which pass on each backend
- name: pjdfs excluded tests, as root (FSKit)
continue-on-error: true
timeout-minutes: 30
run: FUSER_MOUNT_OPTION=backend=fskit PJDFS_EXCLUDED=1 ./tests/macos_pjdfs.sh

- name: pjdfs excluded tests, as root (NFSv3)
continue-on-error: true
timeout-minutes: 30
run: FUSER_FEATURES=macos-nfs PJDFS_EXCLUDED=1 ./tests/macos_pjdfs.sh

# macOS's v4 client cannot chown to root through its identity service, which fails
# before any request reaches the server: mapping ids itself, it can
- name: pjdfs excluded tests, as root (NFSv4.1)
continue-on-error: true
timeout-minutes: 30
run: |
sudo sysctl -w vfs.generic.nfs.client.idmap_ctrl=0
FUSER_FEATURES=macos-nfs FUSER_MOUNT_OPTION=vers=4.1 PJDFS_EXCLUDED=1 ./tests/macos_pjdfs.sh

# The NFS backend's server, with another client than macOS's: Linux's kernel client runs
# the Connectathon suite against it
nfs-linux-client:
Expand All @@ -213,6 +249,9 @@ jobs:
- name: cthon04 through Linux's NFS client
run: ./tests/linux_nfs_cthon.sh

- name: cthon04 through Linux's NFS client (NFSv4.1)
run: NFS_VERS=4.1 FUSER_NFS_PORT=20491 ./tests/linux_nfs_cthon.sh

freebsd-ci:
runs-on: ubuntu-24.04
timeout-minutes: 30
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ New features:
each call into FUSE requests for the unchanged session, so `mount()`, `spawn_mount()` and
`Session` work as before. The NFS server is fuser's own, with no dependencies. Requests all
carry the mounting user's ids, and extended attributes and notifications are not supported.
Linux still uses FUSE
Linux still uses FUSE. With `MountOption::CUSTOM("vers=4")` it mounts with NFSv4.1 instead,
which passes opens and byte-range locks on to the filesystem (more experimental still)
* Add `ReplyCreate::created_with_ttls()` and `ReplyDirectoryPlus::add_with_ttls()` to reply with
distinct entry and attribute TTLs, as `ReplyEntry::entry_with_ttls()` does
* Add `ReplyData::data_vectored()` to reply with data from several buffers without first copying
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ System Extensions. FSKit does not tell the filesystem who made a request: `Reque
does not support the notification API yet. fuser's macOS CI tests use this backend.

Experimental: with the `macos-nfs` feature, fuser needs neither macFUSE nor FUSE-T. It serves the
filesystem over NFSv3 on 127.0.0.1 from within the process and mounts it with macOS's own
`mount_nfs`; filesystems use the same API. NFS carries less than FUSE: every request reaches the
filesystem as the mounting user, and there are no extended attributes or notifications. `MountOption::CUSTOM` values are passed to `mount_nfs`. See
`src/mnt/nfs/mod.rs` for the details.
filesystem over NFS on 127.0.0.1 from within the process and mounts it with macOS's own
`mount_nfs`; filesystems use the same API. NFSv3 is the default, and
`MountOption::CUSTOM("vers=4.1")` mounts with NFSv4.1, which also passes opens and byte-range
locks on to the filesystem. Other `MountOption::CUSTOM` values are passed to `mount_nfs`. NFS
carries less than FUSE: requests carry the caller's uid and gid but no supplementary groups, and
there are no extended attributes or notifications. With NFSv4.1, macOS's client cannot give a
file the owner or group 0 while it maps ids through its identity service: `chown` fails with "No
space left on device". `sudo sysctl vfs.generic.nfs.client.idmap_ctrl=0` has it map them
itself. See `src/mnt/nfs/mod.rs` for the details.


#### To install using Homebrew
Expand Down
3 changes: 3 additions & 0 deletions src/ll/fuse_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ pub(crate) struct fuse_getxattr_out {

#[repr(C)]
#[derive(Debug, FromBytes, KnownLayout, Immutable)]
#[cfg_attr(any(fuser_mount_impl = "nfs", test), derive(IntoBytes))]
pub(crate) struct fuse_lk_in {
pub(crate) fh: u64,
pub(crate) owner: u64,
Expand All @@ -605,12 +606,14 @@ pub(crate) struct fuse_lk_in {

#[repr(C)]
#[derive(Debug, IntoBytes, KnownLayout, Immutable)]
#[cfg_attr(any(fuser_mount_impl = "nfs", test), derive(FromBytes))]
pub(crate) struct fuse_lk_out {
pub(crate) lk: fuse_file_lock,
}

#[repr(C)]
#[derive(Debug, FromBytes, KnownLayout, Immutable)]
#[cfg_attr(any(fuser_mount_impl = "nfs", test), derive(IntoBytes))]
pub(crate) struct fuse_access_in {
// NOTE: this field is defined as u32 in fuse_kernel.h in libfuse. However, it is then cast
// to an i32 when invoking the filesystem's access method
Expand Down
Loading
Loading