Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp636588rwe; Fri, 14 Apr 2023 07:51:57 -0700 (PDT) X-Google-Smtp-Source: AKy350YUqbzwmAlkQKLw9PkoXQ2dLnYa1HuuBPG2ouVI78CXq032cTciQpPTVV7SFoD2O67U9lEj X-Received: by 2002:a17:90a:d496:b0:247:35c7:bd67 with SMTP id s22-20020a17090ad49600b0024735c7bd67mr3225338pju.46.1681483917385; Fri, 14 Apr 2023 07:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681483917; cv=none; d=google.com; s=arc-20160816; b=OczHFfqIOcG2E+8zQyh6tCCG+swJ7HiDChXUfdrNaTRdjrmWjmrehMwWa/r8VxIWrQ mP2DNBtSbk2WG5eMJxzNhzFP2MMbq1IN/btAhmEWlrYj/3DtN/X6NHvpNTegcD+qBnTc Yk0O1qx9g+YptrojPB/sp0IXIBg+THc16XP4L2O3pq7co0tWi76k4HL5IMi+zGtIcT3f GHCrrZSZrk9fXDzdsXaNFdSuBXrX6lLy6dZDogKIvySAnctrn3i3ZDQP5cL9FHpN+jpl DE+2VAdZinkQ4Ton/H5uUh8/7DiqzsvFZCHuG0GEK4nH1Sk69oSLMdF7uw0ZwbmbUq8F U9PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=LIlB5aFX/8xXscr9HPR04GLRxb4jF+bQR7WP/SgFCR4=; b=MmOIE91faQe6XD2/s1V/9MOL8U9h9GxV/MPzk9DycdXlUnnZxde/Up9bGnnWGdRQNQ mdiQfI4mHwJGd8PhQHBY9JOSjOP+OmcKQMTsJoHIU/98GEU2DZcbCjXAcn1mJxkBykJa +rQiAnP2gAJyL4Qgrj7gY5aWN7j76aOAl6+5Q48/c3hIU4RJT7Z6LSxzaVgTVY2yvV95 GcMiDyup7Df9EaPKCa//Fbc+2gN3QvHJiRnsSTiTAWt4VS/K0Vf3r1X28i2jjB/Cj2F6 8NyyA6s+jfKDmSoTfRrb/8Qi9sC0D3aG1jTARJobqOQEKlgiq1/YyaCcDqL+bSva1UuE oO6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@earthlink.net header.s=dk12062016 header.b=HmxyyzUm; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mindspring.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v17-20020a17090a899100b002409b4c5367si4696295pjn.124.2023.04.14.07.51.44; Fri, 14 Apr 2023 07:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@earthlink.net header.s=dk12062016 header.b=HmxyyzUm; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mindspring.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbjDNOmL (ORCPT + 99 others); Fri, 14 Apr 2023 10:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbjDNOmI (ORCPT ); Fri, 14 Apr 2023 10:42:08 -0400 Received: from mta-101a.earthlink-vadesecure.net (mta-101a.earthlink-vadesecure.net [51.81.61.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC43BB92 for ; Fri, 14 Apr 2023 07:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; bh=LIlB5aFX/8xXscr9HPR04GLRxb4jF+bQR7WP/S gFCR4=; c=relaxed/relaxed; d=earthlink.net; h=from:reply-to:subject: date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to: references:list-id:list-help:list-unsubscribe:list-subscribe:list-post: list-owner:list-archive; q=dns/txt; s=dk12062016; t=1681483286; x=1682088086; b=HmxyyzUmBgn5giTV85AhGhqvxWQjUknJpDPZJZQdR1hsvvXiVeOOlm8 MzxAaMFcqMKVCXjBu1VEs/8XK4ZhtpHwHgohyRoUYwk50R8Ni8q131W0khjdqWd4rybdnaK 269GtZDY8XgfrWgGwWeT4p635iDpNyeHqGqA4AqpKXIMrRJsRfJAxBHyI7GUe8gQi6wP1Ut IBNTG25nf60rYXGWsQprXkw8v4H4RcUS5OPkaiPkN2uhh7d6b2NnBD8DQ/lRJpKiqYrFcNW Z76+R0OSuV7eVQux5UYmyIG5EPI8TdnHKYfH0+i1CMsxmu/5CNGgHmjb/6JGXiIBdikqGrL gwA== Received: from FRANKSTHINKPAD ([174.174.49.201]) by smtp.earthlink-vadesecure.net ESMTP vsel1nmtao01p with ngmta id fc8596b1-1755d423bc3f6a11; Fri, 14 Apr 2023 14:41:26 +0000 From: "Frank Filz" To: "'Calum Mackay'" , "'Jeff Layton'" Cc: , , "'Frank Filz'" References: <20230313112401.20488-1-jlayton@kernel.org> <20230313112401.20488-6-jlayton@kernel.org> <05c001d955dc$dc7e6fa0$957b4ee0$@mindspring.com> In-Reply-To: Subject: RE: [pynfs PATCH v2 5/5] LOCK24: fix the lock_seqid in second lock request Date: Fri, 14 Apr 2023 07:41:25 -0700 Message-ID: <082c01d96edf$311da8d0$9358fa70$@mindspring.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQIOChUlYc/UeF2748/fISU/E8FFiQF2dM0fAnHwFpkDi12hUK6GC4hw Content-Language: en-us Authentication-Results: earthlink-vadesecure.net; auth=pass smtp.auth=ffilzlnx@mindspring.com smtp.mailfrom=ffilzlnx@mindspring.com; X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > -----Original Message----- > From: Calum Mackay [mailto:calum.mackay@oracle.com] > Sent: Thursday, April 13, 2023 11:35 AM > To: Frank Filz ; 'Jeff Layton' = > Cc: Calum Mackay ; bfields@fieldses.org; = linux- > nfs@vger.kernel.org; 'Frank Filz' > Subject: Re: [pynfs PATCH v2 5/5] LOCK24: fix the lock_seqid in second = lock > request >=20 > Now that I have some repo space (thank you Trond), I am putting things > together=E2=80=A6 >=20 > On 13/03/2023 6:51 pm, Frank Filz wrote: > > Looks good to me, tested against Ganesha and the updated patch = passes. >=20 > Frank, may I add your Tested-by:, for 5/5 please? Yes, definitely. Frank Tested-by: Frank Filz >=20 > cheers, > calum. >=20 >=20 > > > > Frank > > > >> -----Original Message----- > >> From: Jeff Layton [mailto:jlayton@kernel.org] > >> Sent: Monday, March 13, 2023 4:24 AM > >> To: calum.mackay@oracle.com > >> Cc: bfields@fieldses.org; ffilzlnx@mindspring.com; > > linux-nfs@vger.kernel.org; > >> Frank Filz > >> Subject: [pynfs PATCH v2 5/5] LOCK24: fix the lock_seqid in second > >> lock > > request > >> > >> This test currently fails against Linux nfsd, but I think it's the > >> test > > that's wrong. It > >> basically does: > >> > >> open for read > >> read lock > >> unlock > >> open upgrade > >> write lock > >> > >> The write lock above is sent with a lock_seqid of 0, which is = wrong. > >> RFC7530/16.10.5 says: > >> > >> o In the case in which the state has been created and the [new > >> lockowner] boolean is true, the server rejects the request = with the > >> error NFS4ERR_BAD_SEQID. The only exception is where there = is a > >> retransmission of a previous request in which the boolean = was > >> true. In this case, the lock_seqid will match the original > >> request, and the response will reflect the final case, = below. > >> > >> Since the above is not a retransmission, knfsd is correct to reject > >> this > > call. This > >> patch fixes the open_sequence object to track the lock seqid and = set > >> it > > correctly > >> in the LOCK request. > >> > >> With this, LOCK24 passes against knfsd. > >> > >> Cc: Frank Filz > >> Fixes: 4299316fb357 (Add LOCK24 test case to test open > >> uprgade/downgrade > >> scenario) > >> Signed-off-by: Jeff Layton > >> --- > >> nfs4.0/servertests/st_lock.py | 6 +++++- > >> 1 file changed, 5 insertions(+), 1 deletion(-) > >> > >> diff --git a/nfs4.0/servertests/st_lock.py > >> b/nfs4.0/servertests/st_lock.py > > index > >> 468672403ffe..9d650ab017b9 100644 > >> --- a/nfs4.0/servertests/st_lock.py > >> +++ b/nfs4.0/servertests/st_lock.py > >> @@ -886,6 +886,7 @@ class open_sequence: > >> self.client =3D client > >> self.owner =3D owner > >> self.lockowner =3D lockowner > >> + self.lockseqid =3D 0 > >> def open(self, access): > >> self.fh, self.stateid =3D = self.client.create_confirm(self.owner, > >> access=3Daccess, > >> @@ -900,14 +901,17 @@ class open_sequence: > >> self.client.close_file(self.owner, self.fh, self.stateid) > >> def lock(self, type): > >> res =3D self.client.lock_file(self.owner, self.fh, = self.stateid, > >> - type=3Dtype, lockowner=3Dself.lockowner) > >> + type=3Dtype, = lockowner=3Dself.lockowner, > >> + lockseqid=3Dself.lockseqid) > >> check(res) > >> if res.status =3D=3D NFS4_OK: > >> self.lockstateid =3D res.lockid > >> + self.lockseqid +=3D 1 > >> def unlock(self): > >> res =3D self.client.unlock_file(1, self.fh, = self.lockstateid) > >> if res.status =3D=3D NFS4_OK: > >> self.lockstateid =3D res.lockid > >> + self.lockseqid +=3D 1 > >> > >> def testOpenUpgradeLock(t, env): > >> """Try open, lock, open, downgrade, close > >> -- > >> 2.39.2 > >