ZFS NFS: read-only does not allow reading

Apparently nfs gets confused because the same filesystem/mountpoint is in part writeable and in part readonly.

Both source and destination is inside the same NFS mount of the same ZFS fileset.

Just to be clear, snapshots are completely independent datasets/filesystems as far as the server is concerned. On a ZFS system, going into .zfs/snapshot/xyz will cause it to automatically mount the snapshot dataset (pool/mydataset@xyz) onto that xyz directory. mount hides this unless you use the -v option - I assume so the output isn't spammed with possibly hundreds of temporary snapshot auto-mounts on a busy system.

I'm not sure how this is handled by nfsv4, but at a basic vfs level, the live dataset and a read-only snapshot are just two separate file systems with different mountpoints.
 
Just to be clear, snapshots are completely independent datasets/filesystems as far as the server is concerned. On a ZFS system, going into .zfs/snapshot/xyz will cause it to automatically mount the snapshot dataset (pool/mydataset@xyz) onto that xyz directory. mount hides this unless you use the -v option - I assume so the output isn't spammed with possibly hundreds of temporary snapshot auto-mounts on a busy system.

I'm not sure how this is handled by nfsv4, but at a basic vfs level, the live dataset and a read-only snapshot are just two separate file systems with different mountpoints.

Right, that is the problem.

A single NFS mount cannot (normally) span several server-side filesystem mounts. ZFS seems to hack that up for snapshots, but not in a complete enough way.

Maybe a solution is to actually export and mount the snapshot separately.
 
On my test setup (15.0-RELEASE, NFS server and client), a minorversion=2 copies a file, but it's empty. I haven't tested 16.0-CURRENT.
PMc, you could try 16.0-CURRENT ... If 16.0-CURRENT shows the same issue ...
Tested on 16.0-CURRENT, affected as well when NFSv4 minorversion=2.

Code:
 # uname -a
FreeBSD WaylandTest.home 16.0-CURRENT FreeBSD 16.0-CURRENT #0 main-n284522-e6083790f217: Mon Mar 16 11:49:56 UTC 2026     root@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
 
  • Thanks
Reactions: PMc
Okayokayokay you win. PR 294010

I think your example in the first post here is better than the one you put into the bug, with the "...".

The copying to "," while making it clear that cwd is in the same ZFS filesystem, but not in the part that is expected to be readonly, is critical to understanding the bug.
 
I think your example in the first post here is better than the one you put into the bug, with the "...".

The copying to "," while making it clear that cwd is in the same ZFS filesystem, but not in the part that is expected to be readonly, is critical to understanding the bug.
I think I added a link to here, too. AND I'm in a hurry have to catch a train tomorrow morning, AND you could have just filed it as well. :/
 
Back
Top