Commit 1ae04b25 authored by Trond Myklebust's avatar Trond Myklebust

NFSv3: Use the readdir fileid as the mounted-on-fileid

When we call readdirplus, set the fileid normally returned by readdir
as the mounted-on-fileid, since that is commonly the case if there is
a mountpoint. To ensure that we get it right, we only set the flag if
the readdir fileid differs from the one returned in the readdirplus
attributes.

This again means that we can avoid the issues described in commit
2ef47eb1 ("NFS: Fix use of nfs_attr_use_mounted_on_fileid()"),
which only fixed NFSv4.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 6c441c25
...@@ -1987,6 +1987,11 @@ int nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, ...@@ -1987,6 +1987,11 @@ int nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
if (entry->fattr->valid & NFS_ATTR_FATTR_V3) if (entry->fattr->valid & NFS_ATTR_FATTR_V3)
entry->d_type = nfs_umode_to_dtype(entry->fattr->mode); entry->d_type = nfs_umode_to_dtype(entry->fattr->mode);
if (entry->fattr->fileid != entry->ino) {
entry->fattr->mounted_on_fileid = entry->ino;
entry->fattr->valid |= NFS_ATTR_FATTR_MOUNTED_ON_FILEID;
}
/* In fact, a post_op_fh3: */ /* In fact, a post_op_fh3: */
p = xdr_inline_decode(xdr, 4); p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL)) if (unlikely(p == NULL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment