]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfsd: Handle file systems without a VOP_VPTOFH()
authorRick Macklem <rmacklem@FreeBSD.org>
Fri, 23 Dec 2022 23:17:34 +0000 (15:17 -0800)
committerRick Macklem <rmacklem@FreeBSD.org>
Fri, 23 Dec 2022 23:17:34 +0000 (15:17 -0800)
commit6fd6a0e342fbfb8513ae56105cf0f85f55c6276e
tree744eeef8178a30131f540bd9f337fd45b5a40bdd
parentc89209c674f2c867a2a3a4cccd4760311399d7e4
nfsd: Handle file systems without a VOP_VPTOFH()

Unlike NFSv3, the NFSv4 server follows mount points
within the file system tree below the NFSv4 root directory.
If there is a file system mounted within this subtree
that returns EOPNOTSUPP for VOP_VPTOFH(), the NFSv4 server
would return an error for the mount point entry.
This resulted in an "I/O error" report from the Linux NFSv4
client.  It also put an error code in the Readdir reply
that is not defined in the NFSv4 RFCs.

For the FreeBSD NFSv4 client, the entry with the error would
be ignored, which I think is reasonable behaviour for a
mounted file system that can never be exported.

This patch changes the NFSv4 server behaviour to ignore the
mount point entry and not send it in the Readdir reply.
It also changes the behaviour of Lookup for the entry so
that it replies ENOENT for the mount point directory, so
that it is consistent with no entry in the Readdir reply.

With these two changes, the Linux client behaviour is the
same as the FreeBSD client behaviour.  It also avoids
putting an unknown error on the wire to the client.

MFC after: 1 week
sys/fs/nfsserver/nfs_nfsdport.c
sys/fs/nfsserver/nfs_nfsdserv.c