From patchwork Tue Jan 10 12:02:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 9507085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC0F4606E1 for ; Tue, 10 Jan 2017 12:02:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A11B42022B for ; Tue, 10 Jan 2017 12:02:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95FE628461; Tue, 10 Jan 2017 12:02:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D3D92022B for ; Tue, 10 Jan 2017 12:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967094AbdAJMCh (ORCPT ); Tue, 10 Jan 2017 07:02:37 -0500 Received: from smtp-o-1.desy.de ([131.169.56.154]:55032 "EHLO smtp-o-1.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966222AbdAJMCg (ORCPT ); Tue, 10 Jan 2017 07:02:36 -0500 X-Clacks-Overhead: GNU Terry Pratchett Received: from smtp-map-1.desy.de (smtp-map-1.desy.de [131.169.56.66]) by smtp-o-1.desy.de (DESY-O-1) with ESMTP id 7A7B92806CF for ; Tue, 10 Jan 2017 13:02:34 +0100 (CET) Received: from ZITSWEEP1.win.desy.de (zitsweep1.win.desy.de [131.169.97.95]) by smtp-map-1.desy.de (DESY_MAP_1) with ESMTP id 6DE0813E83 for ; Tue, 10 Jan 2017 13:02:34 +0100 (MET) Received: from smtp-intra-3.desy.de (lb-40-26.desy.de) by ZITSWEEP1.win.desy.de (Clearswift SMTPRS 5.5.0) with ESMTP id ; Tue, 10 Jan 2017 13:02:34 +0100 Received: from ani.desy.de (zitpcx21033.desy.de [131.169.185.213]) by smtp-intra-3.desy.de (DESY-INTRA-3) with ESMTP id 46BEA114A; Tue, 10 Jan 2017 13:02:34 +0100 (MET) From: Tigran Mkrtchyan To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Tigran Mkrtchyan Subject: [PATCH 2/2] st_write: test server behavior on WRITE with offset+len > maxfilesize Date: Tue, 10 Jan 2017 13:02:29 +0100 Message-Id: <20170110120229.23413-2-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170110120229.23413-1-tigran.mkrtchyan@desy.de> References: <20170110120229.23413-1-tigran.mkrtchyan@desy.de> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tigran Mkrtchyan --- 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")