Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] pynfs nfs4.0 server st_write: fix the amount of data sent in the testLargeData
@ 2017-11-30  8:13 Lu, Xinyu
  2017-11-30 17:04 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Lu, Xinyu @ 2017-11-30  8:13 UTC (permalink / raw)
  To: bfields@redhat.com; +Cc: linux-nfs@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

 nfs4.0 server st_write: fix the amount of data sent in the testLargeData
    
    The maximum amount of data could be writen is NFSSVC_MAXBLKSIZE. The value of NFSSVC_MAXB
LKSIZE defined in the kernel is RPCSVC_MAXPLAYLOAD. If the value written exceeds NFSSVC_MAXBL
KSIZE, the value is fixed as the value of NFSSVC_MAXBLKSIZE. The value of RPCSVC_MAXPAYLOAD i
s 1*1024*1024u and "abcdefghijklmnopq"*0x10000 exceeds it. So the previous test is bound to f
ail and is meaningless.

    Signed-off-by: Lu Xinyu <luxy.fnst@cn.fujitsu.com>

diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
index 710452e..a7dae03 100644
--- a/nfs4.0/servertests/st_write.py
+++ b/nfs4.0/servertests/st_write.py
@@ -130,7 +130,7 @@ def testLargeData(t, env):
     c = env.c1
     c.init_connection()
     fh, stateid = c.create_confirm(t.code)
-    data = "abcdefghijklmnopq" * 0x10000
+    data = "a" * 1024 * 1024
     # Write the data
     pos = 0
     while pos < len(data):



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nfs4.0-server-st_write-fix-the-amount-of-data-sent-i.patch --]
[-- Type: text/x-patch; name="0001-nfs4.0-server-st_write-fix-the-amount-of-data-sent-i.patch", Size: 1267 bytes --]

From 6adc3da0ab17eb7e52b47805e6999d65b043fa7f Mon Sep 17 00:00:00 2001
From: Lu Xinyu <luxy.fnst@cn.fujitsu.com>
Date: Thu, 30 Nov 2017 13:24:15 +0800
Subject: [PATCH] nfs4.0 server st_write: fix the amount of data sent in the
 testLargeData

The maximum amount of data could be writen is NFSSVC_MAXBLKSIZE. The value of NFSSVC_MAXBLKSIZE defined in the kernel is RPCSVC_MAXPLAYLOAD. If the value written exceeds NFSSVC_MAXBLKSIZE, the value is fixed as the value of NFSSVC_MAXBLKSIZE. The value of RPCSVC_MAXPAYLOAD is 1*1024*1024u and "abcdefghijklmnopq"*0x10000 exceeds it. So the previous test is bound to fail and is meaningless.

Signed-off-by: Lu Xinyu <luxy.fnst@cn.fujitsu.com>
---
 nfs4.0/servertests/st_write.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
index 710452e..a7dae03 100644
--- a/nfs4.0/servertests/st_write.py
+++ b/nfs4.0/servertests/st_write.py
@@ -130,7 +130,7 @@ def testLargeData(t, env):
     c = env.c1
     c.init_connection()
     fh, stateid = c.create_confirm(t.code)
-    data = "abcdefghijklmnopq" * 0x10000
+    data = "a" * 1024 * 1024
     # Write the data
     pos = 0
     while pos < len(data):
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pynfs nfs4.0 server st_write: fix the amount of data sent in the testLargeData
  2017-11-30  8:13 [PATCH] pynfs nfs4.0 server st_write: fix the amount of data sent in the testLargeData Lu, Xinyu
@ 2017-11-30 17:04 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2017-11-30 17:04 UTC (permalink / raw)
  To: Lu, Xinyu; +Cc: bfields@redhat.com, linux-nfs@vger.kernel.org

Yes, this test is weird, I'm not sure what to do with it.

If we want the writet to succeed then pynfs should first query the
server for the maximum write size and use that--not every server will
have 1M as the maximum.

Maybe the intent was just to see if the server handles a too-large value
gracefullly.  But in that case it should probably use a much larger
write (to ensure that it will be too much for any server), and be
modified to expect the server to fail.

--b.

On Thu, Nov 30, 2017 at 08:13:14AM +0000, Lu, Xinyu wrote:
>  nfs4.0 server st_write: fix the amount of data sent in the testLargeData
>     
>     The maximum amount of data could be writen is NFSSVC_MAXBLKSIZE. The value of NFSSVC_MAXB
> LKSIZE defined in the kernel is RPCSVC_MAXPLAYLOAD. If the value written exceeds NFSSVC_MAXBL
> KSIZE, the value is fixed as the value of NFSSVC_MAXBLKSIZE. The value of RPCSVC_MAXPAYLOAD i
> s 1*1024*1024u and "abcdefghijklmnopq"*0x10000 exceeds it. So the previous test is bound to f
> ail and is meaningless.
> 
>     Signed-off-by: Lu Xinyu <luxy.fnst@cn.fujitsu.com>
> 
> diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
> index 710452e..a7dae03 100644
> --- a/nfs4.0/servertests/st_write.py
> +++ b/nfs4.0/servertests/st_write.py
> @@ -130,7 +130,7 @@ def testLargeData(t, env):
>      c = env.c1
>      c.init_connection()
>      fh, stateid = c.create_confirm(t.code)
> -    data = "abcdefghijklmnopq" * 0x10000
> +    data = "a" * 1024 * 1024
>      # Write the data
>      pos = 0
>      while pos < len(data):
> 
> 

> From 6adc3da0ab17eb7e52b47805e6999d65b043fa7f Mon Sep 17 00:00:00 2001
> From: Lu Xinyu <luxy.fnst@cn.fujitsu.com>
> Date: Thu, 30 Nov 2017 13:24:15 +0800
> Subject: [PATCH] nfs4.0 server st_write: fix the amount of data sent in the
>  testLargeData
> 
> The maximum amount of data could be writen is NFSSVC_MAXBLKSIZE. The value of NFSSVC_MAXBLKSIZE defined in the kernel is RPCSVC_MAXPLAYLOAD. If the value written exceeds NFSSVC_MAXBLKSIZE, the value is fixed as the value of NFSSVC_MAXBLKSIZE. The value of RPCSVC_MAXPAYLOAD is 1*1024*1024u and "abcdefghijklmnopq"*0x10000 exceeds it. So the previous test is bound to fail and is meaningless.
> 
> Signed-off-by: Lu Xinyu <luxy.fnst@cn.fujitsu.com>
> ---
>  nfs4.0/servertests/st_write.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
> index 710452e..a7dae03 100644
> --- a/nfs4.0/servertests/st_write.py
> +++ b/nfs4.0/servertests/st_write.py
> @@ -130,7 +130,7 @@ def testLargeData(t, env):
>      c = env.c1
>      c.init_connection()
>      fh, stateid = c.create_confirm(t.code)
> -    data = "abcdefghijklmnopq" * 0x10000
> +    data = "a" * 1024 * 1024
>      # Write the data
>      pos = 0
>      while pos < len(data):
> -- 
> 2.13.3
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-30 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30  8:13 [PATCH] pynfs nfs4.0 server st_write: fix the amount of data sent in the testLargeData Lu, Xinyu
2017-11-30 17:04 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox