From patchwork Mon Aug 1 22:35:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1026982 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p71MZBnJ014679 for ; Mon, 1 Aug 2011 22:35:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783Ab1HAWfK (ORCPT ); Mon, 1 Aug 2011 18:35:10 -0400 Received: from fieldses.org ([174.143.236.118]:59102 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211Ab1HAWfJ (ORCPT ); Mon, 1 Aug 2011 18:35:09 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1Qo14i-0003uT-6c; Mon, 01 Aug 2011 18:35:04 -0400 Date: Mon, 1 Aug 2011 18:35:04 -0400 To: "J. Bruce Fields" Cc: Fred Isaman , linux-nfs@vger.kernel.org, Mi Jinlong Subject: Re: [PATCH 0/6] pynfs patches Message-ID: <20110801223503.GB10680@fieldses.org> References: <1311883384-20260-1-git-send-email-bfields@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1311883384-20260-1-git-send-email-bfields@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) From: "J. Bruce Fields" 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 01 Aug 2011 22:35:12 +0000 (UTC) On Thu, Jul 28, 2011 at 04:02:58PM -0400, J. Bruce Fields wrote: > This fixes a RECLAIM_COMPLETE bug that makes the tests work for me > again. > > And also try sharing a few more things between 4.0 and 4.1. > > The same patches are available from > > git://linux-nfs.org/~bfields/pynfs.git master > > My biggest remaining annoyance is that the rename tests all go over the > nfs server's maximum op count. pynfs should really be smart enough to > do the lookups in reasonable chunks. Or we could probably find a > simpler workaround for the rename case. Here's a hack for the case of rename, also applied on top of the "master" branch above. I'd also like to make all lookups relative to the root of the test tree--that just makes sense anyway, and it'd make the maximum length of paths used a property of the tests rather than of the environment (so somebody doesn't get different results just because their test tree is at a longer path). The obstacle is the useblock/usechar/etc. options which take absolute paths. Maybe they should just be looked up once at the start. --b. From 9a477cc5f3ffa3a956f68f5c5b08860f3360c2a4 Mon Sep 17 00:00:00 2001 From: J. Bruce Fields Date: Mon, 1 Aug 2011 18:05:43 -0400 Subject: [PATCH] server41tests: separate lookup from rename The length of the rename compounds is ridiculous, and can cause spurious failures against the linux server, depending on the length of the path to the pynfs test root. So do the lookups in separate compounds from the rename itself. Signed-off-by: J. Bruce Fields --- nfs4.1/server41tests/environment.py | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py index b987e9d..43cb12b 100644 --- a/nfs4.1/server41tests/environment.py +++ b/nfs4.1/server41tests/environment.py @@ -545,12 +545,19 @@ def maketree(sess, tree, root=None, owner=None): else: create_confirm(sess, owner, root + [obj]) +def lookup_obj(sess, path): + compound = [op.putrootfh()] + compound += [op.lookup(comp) for comp in path] + compound += [op.getfh()] + res = sess.compound(compound) + check(res) + return res.resarray[-1].object + def rename_obj(sess, oldpath, newpath): - # Set (sfh) to olddir - ops = use_obj(oldpath[:-1]) + [op.savefh()] - # Set (cfh) to newdir - ops += use_obj(newpath[:-1]) - # Call rename + olddir = lookup_obj(sess, oldpath[:-1]) + newdir = lookup_obj(sess, newpath[:-1]) + ops = [op.putfh(olddir), op.savefh()] + ops += [op.putfh(newdir)] ops += [op.rename(oldpath[-1], newpath[-1])] return sess.compound(ops)