All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Subject: [PATCH 2/2] st_write: test server behavior on WRITE with offset+len > maxfilesize
Date: Tue, 10 Jan 2017 13:02:29 +0100	[thread overview]
Message-ID: <20170110120229.23413-2-tigran.mkrtchyan@desy.de> (raw)
In-Reply-To: <20170110120229.23413-1-tigran.mkrtchyan@desy.de>

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 nfs4.0/servertests/st_write.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
index 710452e..3781210 100644
--- a/nfs4.0/servertests/st_write.py
+++ b/nfs4.0/servertests/st_write.py
@@ -499,3 +499,20 @@ def testStolenStateid(t, env):
     res = c.write_file(fh, _text, stateid=stateid)
     c.security=security
     check(res, [NFS4ERR_ACCESS, NFS4ERR_PERM], "WRITE with stolen stateid")
+
+def testWriteOffsetOverflow(t, env):
+    """WRITE with offset + length bigger than UINT64_MAX
+
+    FLAGS: write all
+    DEPEND: MKFILE
+    CODE: WRT20
+    """
+    c = env.c1
+    c.init_connection()
+
+    max_filesize = c.do_getattr(FATTR4_MAXFILESIZE)
+    fh, stateid = c.create_confirm(t.code)
+    data = "abcde"
+
+    res = c.write_file(fh, data, max_filesize - 1, stateid)
+    check(res, NFS4ERR_INVAL, msg="WRITE with offset + length bigger than UINT64_MAX")
-- 
2.9.3


  reply	other threads:[~2017-01-10 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 12:02 [PATCH 1/2] nfs4lib: update do_getattr to use root_fh if no fh provided Tigran Mkrtchyan
2017-01-10 12:02 ` Tigran Mkrtchyan [this message]
2017-01-11 14:27   ` [PATCH 2/2] st_write: test server behavior on WRITE with offset+len > maxfilesize Mkrtchyan, Tigran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170110120229.23413-2-tigran.mkrtchyan@desy.de \
    --to=tigran.mkrtchyan@desy.de \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.