diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 8dde84b988d9..aa433d077945 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3678,6 +3678,19 @@ ssize_t nfs4_listxattr(struct dentry *dentry, char *buf, size_t buflen) | |||
3678 | return len; | 3678 | return len; |
3679 | } | 3679 | } |
3680 | 3680 | ||
3681 | static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr) | ||
3682 | { | ||
3683 | if (!((fattr->valid & NFS_ATTR_FATTR_FILEID) && | ||
3684 | (fattr->valid & NFS_ATTR_FATTR_FSID) && | ||
3685 | (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL))) | ||
3686 | return; | ||
3687 | |||
3688 | fattr->valid |= NFS_ATTR_FATTR_TYPE | NFS_ATTR_FATTR_MODE | | ||
3689 | NFS_ATTR_FATTR_NLINK; | ||
3690 | fattr->mode = S_IFDIR | S_IRUGO | S_IXUGO; | ||
3691 | fattr->nlink = 2; | ||
3692 | } | ||
3693 | |||
3681 | int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | 3694 | int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, |
3682 | struct nfs4_fs_locations *fs_locations, struct page *page) | 3695 | struct nfs4_fs_locations *fs_locations, struct page *page) |
3683 | { | 3696 | { |
@@ -3704,6 +3717,7 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | |||
3704 | fs_locations->server = server; | 3717 | fs_locations->server = server; |
3705 | fs_locations->nlocations = 0; | 3718 | fs_locations->nlocations = 0; |
3706 | status = rpc_call_sync(server->client, &msg, 0); | 3719 | status = rpc_call_sync(server->client, &msg, 0); |
3720 | nfs_fixup_referral_attributes(&fs_locations->fattr); | ||
3707 | dprintk("%s: returned status = %d\n", __func__, status); | 3721 | dprintk("%s: returned status = %d\n", __func__, status); |
3708 | return status; | 3722 | return status; |
3709 | } | 3723 | } |