From owner-freebsd-hackers@freebsd.org Sat Jan 2 23:58:53 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9ABC84BCED0 for ; Sat, 2 Jan 2021 23:58:53 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-to1can01on061d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5d::61d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D7f4D2sYPz3PwF for ; Sat, 2 Jan 2021 23:58:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dL0yUwbhlJcH4koFXb8d6LZ0xBrKQy7yBFLriu0AWGLYw2Dzztu3B4QWm4qrM9D0N+wRC9PVC4f3Qd0kwdFOb+iyZcw5f6R/l2DfpQ8Zt8hIf+trgNQTZ7fYQtRtVJkLLqZ/QwZCiCa8hr11LJTlkSLoQZCFOHLfDCCNvfZ9vYqsr618VJznvYdj0oCx5qoMwgwhtkkcMub7qYO00HoOBJdLWAjcQPQLwGYqy1ZvvVl0pXGbWUYCe7mr7TCN2DwowI6Co5FOb1Gz4xN63nU28ONjuyu3bW37Tp4FNAZKo5tFgdGK4w1A0iIL1fN4KRG8J3ERrRqIaWRv2xeirkilpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rn2Cg/oNlrOOIR8doEwc8m7qn2xqrgAM+uEQDHhi2aE=; b=eufhlfWBMLDyhCYbupdrZVDwqkKbcfFaews14pAxrOx7HBkApTYvdIAVevILS2mPXcyekhLR6M/FG7AWV5NILQGGUQK42xIPatz8+7N9bP82pfjpHMey2lA23G+bPBnfE0Cs4xYtNuU9P4VS19sVl/6RgyoTH0+x5Fcq5//Q6SxajcZHHJ8d70snVr3+G+29Q67Bk+QJ0uvFqbYDNrxs02gl4YkQho4EEsP/3YiaPuc9n7b2TKI394FII4XiMUsfvM83a5cjcYk4llD8XBvnRhR4e4jcyCNSxhKTpNSSvenzynQqtB07NVpHs69QgDq5ifb/Hp7GAjm2DQVF+F9LyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rn2Cg/oNlrOOIR8doEwc8m7qn2xqrgAM+uEQDHhi2aE=; b=vyRlGvDbfks3DiEWfUdmxQsHfuCVC7fMSzFw/1l2ZvDRic9SfnaFvvXMFZStVC62HX8BBxn+Ajv1pGs3otbttsucw8D8jLzpFcfWY+oVUbniLIbOKQOm++HWq7xP9Xb0jrosv68BVYYVQ9xafkxpIEJllmJyqXLNumrINcbuWJjJ6GNwC0dsCGVo7W5oLtnc/jXa8u4oa1uO9lJ7+XlMGH3jkr2AoJ2BA6Cenx0yLOY3trpYXdSQTEE174uAnJm74VQAauUbU03OhzpLzogCqHKktGw/ET7Kzn8v9/CR9u9e84M6DWgsc9GMjSUD5ylO5O409NApXf8exUKx1C6QUA== Received: from YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:19::29) by YQXPR01MB3093.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:4b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.19; Sat, 2 Jan 2021 23:58:49 +0000 Received: from YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM ([fe80::3d86:c7f9:bc4c:40c0]) by YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM ([fe80::3d86:c7f9:bc4c:40c0%6]) with mapi id 15.20.3721.023; Sat, 2 Jan 2021 23:58:49 +0000 From: Rick Macklem To: Chris Johns CC: "freebsd-hackers@freebsd.org" Subject: Re: sys/fs/nfsclient on RTEMS gets a bad seqid error with open Thread-Topic: sys/fs/nfsclient on RTEMS gets a bad seqid error with open Thread-Index: AQHW39ixX2g8xupI30yVViAOBKgn+qoVAuqAgAACQiQ= Date: Sat, 2 Jan 2021 23:58:49 +0000 Message-ID: References: , <888017f2-eea6-12f9-fb24-04a1e1d95ea8@rtems.org> In-Reply-To: <888017f2-eea6-12f9-fb24-04a1e1d95ea8@rtems.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cc517a92-3de9-4baa-e67c-08d8af7a5996 x-ms-traffictypediagnostic: YQXPR01MB3093: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MJpslhCCtEpLIJrGgQp53uhfu4JCnUajv8v8PiTVhYhN9iDfvXAhWns6SeQyoGuPMx0GG9/2/nylff1OYBZPLSbajgjKmX/4/1tgnpq4Tq9yb9m2DgAli29DxjqVzXnVtdRLHiK8FGVtjBP6p8D02eUutOScQz7umJfIyctiyU4TiNG0mHadldCL9dkrFDRYHIap95xXrtJCZjICi8EyU4jm466skPoo3okUxevkMZsyQs77DJVnPW5UsBljO1A63dYiPWRGx/MP034byMZ66upoDpdLkuA+0UvkzWaAusrlAGAAmresO9Yxe89T5/hv1akJNvAmevvtsVCt7s07TukVZz4Ei/GAazQzV/+wOS7/BtqmcrAzQETGrBUURxZrR/dXt7LQ+fKo+TNzbsIkEQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(346002)(366004)(376002)(39850400004)(136003)(396003)(71200400001)(478600001)(52536014)(33656002)(6506007)(8936002)(76116006)(66556008)(64756008)(91956017)(66476007)(66946007)(66446008)(2906002)(83380400001)(86362001)(6916009)(786003)(4326008)(8676002)(7696005)(26005)(5660300002)(316002)(186003)(55016002)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?X9EUt34YFF2f+9GKWLfoMRE9yOUG6sEFtu/neQHg07LfgG9Fq5XFHyYG3R?= =?iso-8859-1?Q?3oMPFpR2GLRPzUCQg2ulqoADhhDfX88yEoZB9DGnqa5oiLZok1yPopnP7/?= =?iso-8859-1?Q?tNGi/SDGESuwOhOJir0rGBdjNjBzeTAJ5pJwyfxR/N5V69E3DygsjUWrTn?= =?iso-8859-1?Q?JEMtHjhfTz66sO4bODBV4CtlZulpV6bnljTDHe3PcGhi/CwK+ZxZdLDMSU?= =?iso-8859-1?Q?VltLE7H5dCelf4spdHRQ2NMPPYRORHO1BN8iE94EUE2T70AKTumAYGWg3y?= =?iso-8859-1?Q?7ipIWohJ4eGMKk+IRkq4pLAUUlY88+onS0TJUL8abFXcpoZwsaFMHDWQE8?= =?iso-8859-1?Q?QBB5SgzjgtcujPmooNzb7/+F3KK4F0oMRrslejkdGZMheURH1YgVJZ8q0k?= =?iso-8859-1?Q?gtIsLVeTh+6kvhM3/9Ha06jrrrrP/maJlWLjqWTFCEAHqOZ7qgQjQd5hmq?= =?iso-8859-1?Q?yx051bUnmmETiGGKlcFy25GlGrJoaaI0SrEQTGIX9Gvv9AtVb4e8l4zQXj?= =?iso-8859-1?Q?V57xtdqzsh/sZILeoZRhseWDRW/JxKmkZAGEDk8o7SPZ9ewrqn4n2TvM3W?= =?iso-8859-1?Q?hvTQ4YxG6RAeh8kyDi/9Pzm8v9s3GE7GQcWKa2UB553RIPsCBmIuz90b6X?= =?iso-8859-1?Q?5qHTABAWa85qZLR5VzgMThBtpuXTVfxA9BX7izA6RXIyLcXIi176uCv+EV?= =?iso-8859-1?Q?vVlU98tnxiMNJHvVxI0lsnRESAq5VGyT7ptP0wwRSA7chPItdoxN6RUcBh?= =?iso-8859-1?Q?OL451/T5lmCtJ4enE+FWONZ7suBHp0IraGb1s7Tn9NYkyZHNkWZjPHLOKg?= =?iso-8859-1?Q?mef4B81YyVF4iOQAjtcX2Ml9ce9ypnEsHsiz9Mtc0LQQormAUA6o27cpZy?= =?iso-8859-1?Q?88EwpAyLNantzJZQvswznJ41A69LMy0AuLdzpFUp7ANu0foF7D7P9IphmN?= =?iso-8859-1?Q?Fb//9yK74Kd6VzoGhRw7sqlxbdB9YXqHBM+ZmZDT1eILJPRi7lcBOGRf04?= =?iso-8859-1?Q?vDrrBmCyIRpvSFxqA=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: cc517a92-3de9-4baa-e67c-08d8af7a5996 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2021 23:58:49.6407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yMhdjsl3RurZg4O+xawSY2sfNscrhcix0HvsJjlioBkpvrSfhZ8cRj39YwXCdcJItLAQXBoS4P5qeQOhBqgCIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQXPR01MB3093 X-Rspamd-Queue-Id: 4D7f4D2sYPz3PwF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=uoguelph.ca header.s=selector1 header.b=vyRlGvDb; arc=pass (microsoft.com:s=arcselector9901:i=1); dmarc=pass (policy=none) header.from=uoguelph.ca; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 2a01:111:f400:fe5d::61d as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-6.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:111:f400:fe5d::61d:from]; R_DKIM_ALLOW(-0.20)[uoguelph.ca:s=selector1]; FREEFALL_USER(0.00)[rmacklem]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[2a01:111:f400:fe5d::61d:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_LOW(-1.00)[uoguelph.ca:dkim]; DKIM_TRACE(0.00)[uoguelph.ca:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[uoguelph.ca,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jan 2021 23:58:53 -0000 Chris Johns wrote:=0A= [stuff snipped]=0A= >Rick Macklem wrote:=0A= >> Did you do a Setclientid, Setclientidconfirm to set up the clientid?=0A= >=0A= >The nfsclient code by default seemed to do this but now I have set nfsv4 a= s an=0A= >option (required by minorversion) I get a different set of packets being= =0A= >exchanged. I will work with NFSv4.1.=0A= Yes. Setclientid, Setclientidcfrm is NFSv4.0 specific.=0A= For NFSv4.1 and 4.2, the clientid is created/confirmed by=0A= ExchangeID, CreateSession=0A= =0A= rick=0A= =0A= > The first Open should be fine with seqid=3D=3D0 and the reply will flag i= t=0A= > as "needs Openconfirm".=0A= > --> 10026 means the server thinks it has already seen the open_owner=0A= > string for that client.=0A= >=0A= > I'd suggest to capture a packet trace of a mount from the FreeBSD client= =0A= > and then look at it in wireshark, to see what should be happening.=0A= =0A= Yes and thanks, I am doing this. My lack of knowledge about the NFSv4 proto= col=0A= is the issue here :)=0A= =0A= >>> A couple of possibilities:=0A= >>> - The FreeBSD client code depends on an exclusive lock on the vnode=0A= >>> to serialize the Opens.=0A= >>=0A= >> There is only one open call active. This is something I can control.=0A= > If all your Opens are serialized, you can use a single open_owner for=0A= > everything. The open_owner string should always be the same to do=0A= > this.=0A= > The FreeBSD client can do this for NFSv4.1 by specifying "oneopenown"=0A= > as a mount option.=0A= =0A= I had this set.=0A= =0A= >>> --> If what you are doing doesn't serialize them, then that will be = a=0A= >>> problem.=0A= >>> - If the VOP_OPEN() generates an unexpected error (I just ran into this= =0A= >>> on FreeBSD head), then the client might not get things correct.=0A= >>> --> The seqid is incremented for some errors, but not others.=0A= >>=0A= >> I am currently basing this work on the FreeBSD 12 branch we have. A mast= er port=0A= >> is next.=0A= >>=0A= >> Btw, all this seqid stuff goes away when you use NFSv4.1 and there=0A= >> are NFSv4.1 only clients out there. You might want to consider doing=0A= >> this. If I was writing the code now, there would be no NFSv4.0.=0A= >>=0A= >> Ah OK. How do I make the FreeBSD nfsclient operate as NFSv4.1? I looked = into=0A= >> this but I could not figure out how.=0A= > minorversion=3D1 mount option, which sets nm_minorvers to 1.=0A= =0A= Ah yes I see it now. Thank you. I was required to set nfsv4 which is what I= want=0A= but it does make me wonder about the default version I was using. I would h= ave=0A= thought v4 would be the default. Maybe it is something in the defaults in= =0A= mount_nfs that I should take a look at.=0A= =0A= These settings seems to have resolved the situation and I have moved furthe= r and=0A= onto other issues related to the port of the lockmgr.=0A= =0A= Chris=0A=