Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1248729pxb; Fri, 21 Jan 2022 13:19:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEfd25HJSTCMz6qhP9abPvlpOHqP2jZ+bdWxpr4Q/biB4zctuoLgJb1v/z4RoAlALaEL4Y X-Received: by 2002:a17:90a:3e4c:: with SMTP id t12mr2411277pjm.175.1642799969529; Fri, 21 Jan 2022 13:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642799969; cv=none; d=google.com; s=arc-20160816; b=ESKOcF+XL5f/QzLrGVyy83v1P4qiafPmozgszlDd2pBlSzNRBsYwr6nVpAnsiAR/p6 NDPjHEEnJz8/LFb381DBj/1rpQ35yB0vCUoy7AA6Clx8TebyORC9onSxwl3OKuaO6bZm S+0vuHk0BxPgC1RmN9oNicAu2ccXvSn3N2ax3RnPfbh1dEA5AMK3BQsb1+aVCsuwBCbL xh+dSyy6t3Z5+Y3JxoEBaLU0TAt+Ft+IDqFaFfCN0UOfq0qJLrgTb0JpG0tPRjDoQOKx SMQ+8Wh1COFmWz+aTUfr1kpkdzZYLFgoTvvAfE/lyr97BQvGzJSAZy4RBO1wGRX34275 V5mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=RKfa9SFXl6MJ0kJcGesxG+9HhPslYZsN3J7f9633m10=; b=eWkFHTx603T2UCfX89lK6QGUFFuobpSvHAWPypRtnC1xzut7sHyQ51reEvbjOKcFEq AFRbRBjoMAreJ4JMlAUedXox6pt6cbSLqRfGQhJcZCMGbMvmkl6LOvGsapKGl3okJO1+ pJnYX94OcD0X4N8YKbP+P5It6DQhZC4ZOTSHgZZzjll9o3Yq1IzdCuplysoJ72uQVZ3R xjwJlpoiHBgy4UbbvV5f72EtYYqU4EEQlyxJJJe+bUo+2rbPj3pojyXmHE4KOockkWg5 sRz9mWAPg7R1F+RRBjU2ATqv8cO6JUjuYuixlNKi9mQnjh4zeAJnMSrLpmAzzK2KILPi sErg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QPC6kEcY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="KM/S48Dq"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si7885653plx.86.2022.01.21.13.19.16; Fri, 21 Jan 2022 13:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QPC6kEcY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="KM/S48Dq"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbiATKvy (ORCPT + 99 others); Thu, 20 Jan 2022 05:51:54 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:56012 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiATKvj (ORCPT ); Thu, 20 Jan 2022 05:51:39 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 875191F394; Thu, 20 Jan 2022 10:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642675897; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RKfa9SFXl6MJ0kJcGesxG+9HhPslYZsN3J7f9633m10=; b=QPC6kEcYhKJhXsr6aHHC+BypzjpFqxR3IglWvoQ0iO513s31HLy6eOx14yShBLAYczOly7 EbI4fwCQeQkYQFWopq6pF/ahTuBz0LTtGyaUZdC4puf12yhgBavA6DXujcQ+MD2lVwMkIh CwQIoSNxzPDsHtGEwAO2mjsSE9wVPkI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642675897; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RKfa9SFXl6MJ0kJcGesxG+9HhPslYZsN3J7f9633m10=; b=KM/S48DqyD3MH/vsfNSQzGrKpDGKrUWwXQDME4+jZFXrSvZVBfseYQiFQmkBIAzvxxSrp8 1+kMOeSrkifMS0DQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5549213E46; Thu, 20 Jan 2022 10:51:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hpQ7E7k+6WFqMgAAMHmgww (envelope-from ); Thu, 20 Jan 2022 10:51:37 +0000 Date: Thu, 20 Jan 2022 11:51:35 +0100 From: Petr Vorel To: NeilBrown Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, Yong Sun Subject: Re: pynfs: [NFS 4.0] SEC7, LOCK24 test failures Message-ID: Reply-To: Petr Vorel References: <164248153844.24166.16775550865302060652@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164248153844.24166.16775550865302060652@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Neil, > On Wed, 02 Jun 2021, J. Bruce Fields wrote: > > On Tue, Jun 01, 2021 at 04:01:08PM +0200, Petr Vorel wrote: > > > LOCK24 st_lock.testOpenUpgradeLock : FAILURE > > > OP_LOCK should return NFS4_OK, instead got > > > NFS4ERR_BAD_SEQID > > I suspect the server's actually OK here, but I need to look more > > closely. > I agree. > I think this patch fixes the test. > NeilBrown > From: NeilBrown > Date: Tue, 18 Jan 2022 15:50:37 +1100 > Subject: [PATCH] Fix NFSv4.0 LOCK24 test > Only the first lock request for a given open-owner can use lock_file. > Subsequent lock request must use relock_file. Reviewed-by: Petr Vorel Tested-by: Petr Vorel Thanks! > Signed-off-by: NeilBrown > --- > nfs4.0/servertests/st_lock.py | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > diff --git a/nfs4.0/servertests/st_lock.py b/nfs4.0/servertests/st_lock.py > index 468672403ffe..db08fbeedac4 100644 > --- a/nfs4.0/servertests/st_lock.py > +++ b/nfs4.0/servertests/st_lock.py > @@ -886,6 +886,7 @@ class open_sequence: > self.client = client > self.owner = owner > self.lockowner = lockowner > + self.lockseq = 0 > def open(self, access): > self.fh, self.stateid = self.client.create_confirm(self.owner, > access=access, > @@ -899,15 +900,21 @@ class open_sequence: > def close(self): > self.client.close_file(self.owner, self.fh, self.stateid) > def lock(self, type): > - res = self.client.lock_file(self.owner, self.fh, self.stateid, > - type=type, lockowner=self.lockowner) > + if self.lockseq == 0: > + res = self.client.lock_file(self.owner, self.fh, self.stateid, > + type=type, lockowner=self.lockowner) > + else: > + res = self.client.relock_file(self.lockseq, self.fh, self.lockstateid, > + type=type) > check(res) > if res.status == NFS4_OK: > self.lockstateid = res.lockid > + self.lockseq = self.lockseq + 1 I'd just: self.lockseq += 1 (supported even on python 2.x) > def unlock(self): > res = self.client.unlock_file(1, self.fh, self.lockstateid) > if res.status == NFS4_OK: > self.lockstateid = res.lockid > + self.lockseq = self.lockseq + 1 And here. Kind regards, Petr > def testOpenUpgradeLock(t, env): > """Try open, lock, open, downgrade, close