--- fs/nfsclient/nfs_clvfsops.c.sav 2012-01-21 18:55:09.000000000 -0500 +++ fs/nfsclient/nfs_clvfsops.c 2012-01-22 17:57:29.000000000 -0500 @@ -989,6 +989,22 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } + + /* + * Cannot switch to UDP if current rsize/wsize/readdirsize is + * too large, since there may be an I/O RPC in progress that + * will get retried after the switch to the UDP socket. + */ + if (args.sotype == SOCK_DGRAM && + (nmp->nm_rsize > NFS_MAXDGRAMDATA || + nmp->nm_wsize > NFS_MAXDGRAMDATA || + nmp->nm_readdirsize > NFS_MAXDGRAMDATA)) { + vfs_mount_error(mp, + "old rsize/wsize/readdirsize greater than UDP max"); + error = EINVAL; + goto out; + } + /* * When doing an update, we can't change version, * security, switch lockd strategies or change cookie