[PATCH 2/2] st_write: test server behavior on WRITE with offset+len > maxfilesize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@xxxxxxx>
---
 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

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



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux