nfs: READDIR for referrals should conform to RFC 7530
NFSv4 server should reply NFS4ERR_MOVED if a client sends READDIR that does not include either of the attributes fs_locations or rdattr_error.
But current implementation returns NFS4_OK in this case.
8.3.2. READDIR and Absent File Systems
A READDIR performed when the current filehandle is within an absent
file system will result in an NFS4ERR_MOVED error, since, unlike the
case of GETATTR, no such exception is made for READDIR.
Attributes for an absent file system may be fetched via a READDIR for
a directory in a present file system, when that directory contains
the root directories of one or more absent file systems. In this
case, the handling is as follows:
o If the attribute set requested includes fs_locations, then the
fetching of attributes proceeds normally, and no NFS4ERR_MOVED
indication is returned even when the rdattr_error attribute is
o If the attribute set requested does not include fs_locations, then
if the rdattr_error attribute is requested, each directory entry
for the root of an absent file system will report NFS4ERR_MOVED as
the value of the rdattr_error attribute.
o If the attribute set requested does not include either of the
attributes fs_locations or rdattr_error, then the occurrence of
the root of an absent file system within the directory will result
in the READDIR failing with an NFS4ERR_MOVED error.
o The unavailability of an attribute because of a file system's
absence, even one that is ordinarily REQUIRED, does not result in
any error indication. The set of attributes returned for the root
directory of the absent file system in that case is simply
restricted to those actually available.