Skip to contentSkip to conversation

NFS: Revert default r/wsize behavior

PATCH In review Chuck Lever 3 participants 5 messages Sep 10, 2009 – Sep 30, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFS: Revert default r/wsize behavior

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 largest 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 binary mounts, the values are set to zero if these options are not specified.

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

Thanks to James Pearson <[email protected]> for reporting and diagnosing the problem.

---

James-

Is this what you want?

 fs/nfs/super.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
fs/nfs/super.c +0 -4
index bde444b..cf0d754 100644
@@ -1635,8 +1635,6 @@ static int nfs_validate_mount_data(void *options,
 		goto out_no_data;
 
 	args->flags		= (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;
@@ -2351,8 +2349,6 @@ static int nfs4_validate_mount_data(void *options,
 	if (data == NULL)
 		goto out_no_data;
 
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;

A message that is not in the archive (sent off-list or not yet received): 20090910205950.3670.7878.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org

#2 lore raw
Quoted 22 lines · Chuck Lever

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 largest 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 binary mounts, the values are set to zero if these options are not specified.

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

Thanks to James Pearson <[email protected]> for reporting and diagnosing the problem.

Quoted 6 lines

---

James-

Is this what you want?

Hmm.... Strictly speaking, I don't think we need to do this for the NFSv4 case, since that has no equivalent to the NFSv3 rtpref/wtpref attribute. It might help make the code look more consistent, though.

Note: at some point soon, I want to clean those functions up by introducing an 'alloc_nfs_parsed_mount_data()' function that both allocates the nfs_parsed_mount_data structure and initialises it with the common defaults.

Quoted 30 lines
 fs/nfs/super.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
fs/nfs/super.c +0 -5
index bde444b..cf0d754 100644
@@ -1635,8 +1635,6 @@ static int nfs_validate_mount_data(void *options,
 		goto out_no_data;
 
 	args->flags		= (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;
@@ -2351,8 +2349,6 @@ static int nfs4_validate_mount_data(void *options,
 	if (data == NULL)
 		goto out_no_data;
 
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1252617432.8722.157.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org

#4 lore raw
Quoted 26 lines · Trond Myklebust
Quoted 25 lines · Chuck Lever

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 largest 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 binary mounts, the values are set to zero if these options are not specified.

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

Thanks to James Pearson <[email protected]> for reporting and diagnosing the problem.

---

Quoted 7 lines
Quoted 3 lines

James-

Is this what you want?

Hmm.... Strictly speaking, I don't think we need to do this for the NFSv4 case, since that has no equivalent to the NFSv3 rtpref/wtpref attribute. It might help make the code look more consistent, though.

I was just about to check that against mount.nfs4.

Quoted 4 lines

Note: at some point soon, I want to clean those functions up by introducing an 'alloc_nfs_parsed_mount_data()' function that both allocates the nfs_parsed_mount_data structure and initialises it with the common defaults.

Sounds good.

Quoted 28 lines

fs/nfs/super.c | 4 ----

Quoted 27 lines
1 files changed, 0 insertions(+), 4 deletions(-)
fs/nfs/super.c +0 -2
index bde444b..cf0d754 100644
@@ -1635,8 +1635,6 @@ static int nfs_validate_mount_data(void  
 *options,
 		goto out_no_data;
 
 	args->flags		= (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
	args->acdirmin		= NFS_DEF_ACDIRMIN;
fs/nfs/super.c +0 -2
@@ -2351,8 +2349,6 @@ static int nfs4_validate_mount_data(void  
 *options,
 	if (data == NULL)
 		goto out_no_data;
 
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
	args->acdirmin		= NFS_DEF_ACDIRMIN;
Quoted 6 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Trond Myklebust

Hmm.... Strictly speaking, I don't think we need to do this for the NFSv4 case, since that has no equivalent to the NFSv3 rtpref/wtpref attribute. It might help make the code look more consistent, though.

Note: at some point soon, I want to clean those functions up by introducing an 'alloc_nfs_parsed_mount_data()' function that both allocates the nfs_parsed_mount_data structure and initialises it with the common defaults.

I notice that 2.6.32-rc1 now has the 'alloc_nfs_parsed_mount_data()' function - but [rw]size still defaults to NFS_MAX_FILE_IO_SIZE - shouldn't these now be set to 0 by default?

Thanks

James Pearson

#6 lore raw
In reply to a message not in the archive
Quoted 46 lines · Chuck Lever

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 largest 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 binary mounts, the values are set to zero if these options are not specified.

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

Thanks to James Pearson <[email protected]> for reporting and diagnosing the problem.

---

James-

Is this what you want?

 fs/nfs/super.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
fs/nfs/super.c +0 -2
index bde444b..cf0d754 100644
@@ -1635,8 +1635,6 @@ static int nfs_validate_mount_data(void *options,
 		goto out_no_data;
 
 	args->flags		= (NFS_MOUNT_VER3 | NFS_MOUNT_TCP);
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;

fs/nfs/super.c static int nfs4_validate_mount_data(void *options, · line 2354

Quoted 8 lines
fs/nfs/super.c +0 -2
@@ -2351,8 +2349,6 @@ static int nfs4_validate_mount_data(void *options,
 	if (data == NULL)
 		goto out_no_data;
 
-	args->rsize		= NFS_MAX_FILE_IO_SIZE;
-	args->wsize		= NFS_MAX_FILE_IO_SIZE;
 	args->acregmin		= NFS_DEF_ACREGMIN;
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;

That is what I've already done myself for the NFSv3 case - personally I would implicitly set args->[rw]size to zero (although args would have been initialled with kzalloc()), just to make it clear that the defaults are zero.

Thanks

James Pearson