Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSv4.1: Apply session size limits on clone path

nfs4_clone_server() builds a child nfs_server for same-server
automounted submounts but never calls nfs4_session_limit_rwsize()
or nfs4_session_limit_xasize() after nfs_clone_server(). This means
the child mount can end up with rsize/wsize values that exceed the
negotiated session channel limits, causing NFS4ERR_REQ_TOO_BIG and
EIO on servers that enforce tight max_request_size budgets.

Top-level mounts go through nfs4_server_common_setup() which calls
these limiters after nfs_probe_server(). Apply the same clamping on
the clone path for consistency.

Fixes: 2b092175f5e3 ("NFS: Fix inheritance of the block sizes when automounting")
Cc: stable@vger.kernel.org
Signed-off-by: Tushar Sariya <tushar.97@hotmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Tushar Sariya and committed by
Trond Myklebust
8c787b28 515af100

+7 -2
+2
fs/nfs/internal.h
··· 253 253 u32 minor_version); 254 254 extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, 255 255 struct inode *); 256 + extern void nfs4_session_limit_rwsize(struct nfs_server *server); 257 + extern void nfs4_session_limit_xasize(struct nfs_server *server); 256 258 extern struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv, 257 259 const struct sockaddr_storage *ds_addr, int ds_addrlen, 258 260 int ds_proto, unsigned int ds_timeo,
+2 -2
fs/nfs/nfs4client.c
··· 855 855 * Limit the mount rsize, wsize and dtsize using negotiated fore 856 856 * channel attributes. 857 857 */ 858 - static void nfs4_session_limit_rwsize(struct nfs_server *server) 858 + void nfs4_session_limit_rwsize(struct nfs_server *server) 859 859 { 860 860 struct nfs4_session *sess; 861 861 u32 server_resp_sz; ··· 878 878 /* 879 879 * Limit xattr sizes using the channel attributes. 880 880 */ 881 - static void nfs4_session_limit_xasize(struct nfs_server *server) 881 + void nfs4_session_limit_xasize(struct nfs_server *server) 882 882 { 883 883 #ifdef CONFIG_NFS_V4_2 884 884 struct nfs4_session *sess;
+3
fs/nfs/nfs4proc.c
··· 10637 10637 if (IS_ERR(server)) 10638 10638 return server; 10639 10639 10640 + nfs4_session_limit_rwsize(server); 10641 + nfs4_session_limit_xasize(server); 10642 + 10640 10643 error = nfs4_delegation_hash_alloc(server); 10641 10644 if (error) { 10642 10645 nfs_free_server(server);