aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4xdr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index f6a1ea7df374..4b6613f61341 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -2326,6 +2326,22 @@ static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t
2326 return 0; 2326 return 0;
2327} 2327}
2328 2328
2329static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid)
2330{
2331 uint32_t *p;
2332
2333 *fileid = 0;
2334 if (unlikely(bitmap[1] & (FATTR4_WORD1_MOUNTED_ON_FILEID - 1U)))
2335 return -EIO;
2336 if (likely(bitmap[1] & FATTR4_WORD1_MOUNTED_ON_FILEID)) {
2337 READ_BUF(8);
2338 READ64(*fileid);
2339 bitmap[1] &= ~FATTR4_WORD1_MOUNTED_ON_FILEID;
2340 }
2341 dprintk("%s: fileid=%Lu\n", __FUNCTION__, (unsigned long long)*fileid);
2342 return 0;
2343}
2344
2329static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) 2345static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res)
2330{ 2346{
2331 uint32_t *p; 2347 uint32_t *p;
@@ -2983,6 +2999,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
2983 bitmap[2] = {0}, 2999 bitmap[2] = {0},
2984 type; 3000 type;
2985 int status, fmode = 0; 3001 int status, fmode = 0;
3002 uint64_t fileid;
2986 3003
2987 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) 3004 if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
2988 goto xdr_error; 3005 goto xdr_error;
@@ -3032,6 +3049,10 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
3032 goto xdr_error; 3049 goto xdr_error;
3033 if ((status = decode_attr_time_modify(xdr, bitmap, &fattr->mtime)) != 0) 3050 if ((status = decode_attr_time_modify(xdr, bitmap, &fattr->mtime)) != 0)
3034 goto xdr_error; 3051 goto xdr_error;
3052 if ((status = decode_attr_mounted_on_fileid(xdr, bitmap, &fileid)) != 0)
3053 goto xdr_error;
3054 if (fattr->fileid == 0 && fileid != 0)
3055 fattr->fileid = fileid;
3035 if ((status = verify_attr_len(xdr, savep, attrlen)) == 0) 3056 if ((status = verify_attr_len(xdr, savep, attrlen)) == 0)
3036 fattr->valid = NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4; 3057 fattr->valid = NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4;
3037xdr_error: 3058xdr_error: