NFS: Revert default r/wsize behavior
authorChuck Lever <chuck.lever@oracle.com>
Thu, 3 Dec 2009 20:58:56 +0000 (15:58 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:01:18 +0000 (15:01 -0800)
commit5e057878f946d25bf3a3bc811f4e27099f41c24f
tree676c1b3f6226bef5fce1f396ad5a7f0cb01679da
parent1d42a1bd932f8963c5c5b4944baabb7e74b6e8e2
NFS: Revert default r/wsize behavior

commit dd47f96c077b4516727e497e4b6fd47a06778c0a upstream.

When the "rsize=" or "wsize=" mount options are not specified,
text-based mounts have slightly different behavior than legacy binary
mounts.  Text-based mounts use the smaller of the server's maximum
and the client's maximum, but binary mounts use the smaller of the
server's _preferred_ size and the client's maximum.

This difference is actually pretty subtle.  Most servers advertise
the same value as their maximum and their preferred transfer size, so
the end result is the same in most cases.

The reason for this difference is that for text-based mounts, if
r/wsize are not specified, they are set to the largest value supported
by the client.  For legacy mounts, the values are set to zero if these
options are not specified.

nfs_server_set_fsinfo() can negotiate the transfer size defaults
correctly in any case.  There's no need to specify any particular
value as default in the text-based option parsing logic.

Note that nfs4 doesn't use nfs_server_set_fsinfo(), but the mount.nfs4
command does set rsize and wsize to 0 if the user didn't specify these
options.  So, make the same change for text-based NFSv4 mounts.

Thanks to James Pearson <james-p@moving-picture.com> for reporting and
diagnosing the problem.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/super.c