Re: RFC: atime and ZFS snapshots

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.current
Message-ID <[email protected]>
On Tue, Mar 24, 2026 at 04:20:20PM -0700, Rick Macklem wrote:
> Hi,
> 
> Commit cc760de and 57ce37f (in main) modified the
> NFSv4.2 behaviour to attempt to always make the
> atime get updated for the <from> file for copy_file_range(2).
> (At the time, the concensus seemed to be that this was
> correct behaviour.)
> 
> This was done via a Setattr of atime unless "noatime"
> is specified on the mount.
> 
> But, for a file in a ZFS snapshot, the atime never gets
> updated (not surprising) and, as such, EROFS gets
> replied unless "noatime" is specified for an NFSv4.2
> mount.
> 
> Does this sound correct or should the NFSv4.2 server
> ignore the EROFS reply for Setattr of atime and allow
> the Copy?

This triggered some memories, and indeed we have the VOP_MMAPPED()
implemented only for UFS.  The goal was to confirm to the POSIX
requirement that mmaping the file should update its access time.

I think that
- the VOP is not quite correctly named, but this is minor
- I do not see why it is missed for ZFS and probably tmpfs as well,
  IMO this is a bug
- you can use it for optional update of the access time for generic
  copy_file_range implementation, and then same can be done in
  fs-specific VOP as well.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.