From patchwork Thu Dec 30 03:16:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mi Jinlong X-Patchwork-Id: 440331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBUMBEm8000490 for ; Thu, 30 Dec 2010 22:12:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754802Ab0L3DLz (ORCPT ); Wed, 29 Dec 2010 22:11:55 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:61229 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754781Ab0L3DLy (ORCPT ); Wed, 29 Dec 2010 22:11:54 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id CD142170CA4; Thu, 30 Dec 2010 11:11:49 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oBU36n1R002145; Thu, 30 Dec 2010 11:06:50 +0800 Received: from [127.0.0.1] ([10.167.225.24]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010123011113613-69308 ; Thu, 30 Dec 2010 11:11:36 +0800 Message-ID: <4D1BF99C.6030702@cn.fujitsu.com> Date: Thu, 30 Dec 2010 11:16:44 +0800 From: Mi Jinlong User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: "J. Bruce Fields" CC: NFSv3 list Subject: Re: [PATCH] NFS4.1: Fix bug server don't reply the right fore_channel to client at create_session References: <4CDBBF7C.90108@cn.fujitsu.com> <20101112204554.GF32745@fieldses.org> <4CE0EB7B.5060509@cn.fujitsu.com> <20101229193551.GB12218@fieldses.org> In-Reply-To: <20101229193551.GB12218@fieldses.org> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-30 11:11:36, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-30 11:11:36, Serialize complete at 2010-12-30 11:11:36 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Dec 2010 22:12:10 +0000 (UTC) diff --git a/nfs4.1/server41tests/st_create_session.py b/nfs4.1/server41tests/st_create_session.py index 5f425d4..5cfac14 100644 --- a/nfs4.1/server41tests/st_create_session.py +++ b/nfs4.1/server41tests/st_create_session.py @@ -363,3 +363,22 @@ def testCallbackVersion(t, env): (cb_occurred.low, cb_occurred.hi, cb_occurred.vers)) finally: env.c1._check_version = orig + +def testMaxreqs(t, env): + """A CREATE_SESSION with maxreqs too large should return + a modified value + + FLAGS: create_session all + CODE: CSESS22 + """ + # Assuming this is too large for any server; increase if necessary: + # but too huge will eat many memory for replay_cache, becareful it! + TOO_MANY_SLOTS = 500 + + c = env.c1.new_client(env.testname(t)) + # CREATE_SESSION with fore_channel = TOO_MANY_SLOTS + chan_attrs = channel_attrs4(0,8192,8192,8192,128, TOO_MANY_SLOTS, []) + sess1 = c.create_session(fore_attrs=chan_attrs) + if nfs4lib.test_equal(sess1.fore_channel.maxrequests, + chan_attrs.ca_maxrequests, "count4"): + fail("Server allows surprisingly large fore_channel maxreqs")