Skip to content

Commit 8eed292

Browse files
Olga KornievskaiaTrond Myklebust
authored andcommitted
NFSv3: fix rpc receive buffer size for MOUNT call
Prior to commit e3d3ab64dd66 ("SUNRPC: Use au_rslack when computing reply buffer size"), there was enough slack in the reply buffer to commodate filehandles of size 60bytes. However, the real problem was that the reply buffer size for the MOUNT operation was not correctly calculated. Received buffer size used the filehandle size for NFSv2 (32bytes) which is much smaller than the allowed filehandle size for the v3 mounts. Fix the reply buffer size (decode arguments size) for the MNT command. Fixes: 2c94b8e ("SUNRPC: Use au_rslack when computing reply buffer size") Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 933496e commit 8eed292

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/mount_clnt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
#define encode_dirpath_sz (1 + XDR_QUADLEN(MNTPATHLEN))
3131
#define MNT_status_sz (1)
3232
#define MNT_fhandle_sz XDR_QUADLEN(NFS2_FHSIZE)
33+
#define MNT_fhandlev3_sz XDR_QUADLEN(NFS3_FHSIZE)
3334
#define MNT_authflav3_sz (1 + NFS_MAX_SECFLAVORS)
3435

3536
/*
3637
* XDR argument and result sizes
3738
*/
3839
#define MNT_enc_dirpath_sz encode_dirpath_sz
3940
#define MNT_dec_mountres_sz (MNT_status_sz + MNT_fhandle_sz)
40-
#define MNT_dec_mountres3_sz (MNT_status_sz + MNT_fhandle_sz + \
41+
#define MNT_dec_mountres3_sz (MNT_status_sz + MNT_fhandlev3_sz + \
4142
MNT_authflav3_sz)
4243

4344
/*

0 commit comments

Comments
 (0)