From nobody Thu Jun 2 15:41:47 2022 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 106981B6F634 for ; Thu, 2 Jun 2022 15:41:55 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-YT3-obe.outbound.protection.outlook.com (mail-yt3can01on2070.outbound.protection.outlook.com [40.107.115.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LDVcf21p2z4skx for ; Thu, 2 Jun 2022 15:41:54 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JGqPrPaGL00gcx90zVWIWhQqVNbgvuNwILgQ0RLJFGChKS2jfen7Y0jhe+ZwNGOPFPJiVG8CXAgNeLAd5QoGum0+WNyKxdn9/AJeK3LTBMG0+5snHs2spPLHKPjJ9B9PDnHLa+uD439ehKPGIrpqE9z2O7vAG3jgdOoUgkwmfc6Q7ImjWRELMW3kcxx7kG7Popp+2voMkJYN0JnbPPmsonHXXobRcghGhjSsQRweOPRCRSZ0zMmH/te+EBne9JoDnsxWGxS3U0EMYfHhr52Zq1HSA4t98HcSTwS7hIIZFibmK/dnhTXWXnq9Wmxbm6LWJ3E0Mt1fza4tuRpvbFRz4A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mYJ1pZB0oI2EE4xZp0fXoL1FPZaPGHpXMNW3rUwXRUY=; b=ezDmKixJVfh2V6O/liHEjcXazmLiZ0DLRYHc2MTaCMsXqYHk6J0EgsJBeZzU04HHMBGpBPGHqpB19jJJXE8gVhOThJaAbQzF8kwnGl+llTABfXMI6ZOZg+qtN1Za5GvtGUfJ8CnllRInxqiqYkPeVspTsRihfO3WLAGp07hSjp7lDUoR1V9PXOM1vUhU1ECDIlUCgT+Tda7jV4W/biGgxbVWhxYL9I5E+alAKbffb3gs/fDqokuKgDfv6sn5N0817/2P8+tZ9bX2GphDGbIGYK/S9MTykOuRqSHx3mdic0VGQubX2SuhXynB3PvCefLaDnUw3C3++h6z+fqSLw7JZQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mYJ1pZB0oI2EE4xZp0fXoL1FPZaPGHpXMNW3rUwXRUY=; b=lkNWUosiKH3JxbwKxn7AACt6cHr7Rb4fgg5NIhyR/RCzPYWyEQ5b0CUG2Dg5+pOhVUFKwC949j9QYOGkdV7brZQW3GqnQ5rp97P8E4eFtkgxdzh6/tAj0+KFz+cKM8D+MVBzt+rRaVpTE4oeOYhhF+2G93dO4pgrxU2P9Ju5ksvbNrkpl+p0ObrmBdtZEjrw4jIPxqhWVRu0onXLo2yplySBPcBU/8Kgh1q7Q/PYfxiZ3VXgMznqlUgmgIHrP2jLDLIK4byaLqUW4bhw6N3DMEf70jRXYli7Y7FrQNzgrbVhULCrIcyt6dDaIad+jB9esLj+rggWs0GHiuTnE8n7NA== Received: from YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:81::14) by YT1PR01MB4186.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:33::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 15:41:47 +0000 Received: from YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM ([fe80::b921:251e:4a0b:54fc]) by YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM ([fe80::b921:251e:4a0b:54fc%5]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 15:41:47 +0000 From: Rick Macklem To: John-Mark Gurney , "freebsd-net@FreeBSD.org" Subject: Re: make NFSv3 default now on diskless Thread-Topic: make NFSv3 default now on diskless Thread-Index: AQHYdjCDfn9SS+WTMkmngJsQNvSiya08K0uvgAAN4MQ= Date: Thu, 2 Jun 2022 15:41:47 +0000 Message-ID: References: <20220602032456.GY88842@funkthat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: df9ced99-c448-be9d-20a5-f0617c6847b6 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 167ac41e-85b1-4b43-6140-08da44ae671b x-ms-traffictypediagnostic: YT1PR01MB4186:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2f4ORYtIa4kPXzxDHZqc8oRp8fWKtORLfR8TvIY4b8Q+3KQPwgBYpB+BgR+B/Tjd9CyZaAZiK5ds6CxKLnxKSDfKAzFGgAV/nwas3IRvbyILHt0qw5OdGhPYoy0KopkFcfy/GVGhe/TcxEwPpyV17LlRz1hBiWQtvN/PmSxrFjlz0nP4QO7p+Q3EgqMpWPmFtmzavbf/NB1OnrFTdqm3XPMIMnuqlOTX0iNfhKessomLVPmGgFqrB9M1cziG1tdkvR9yqJ6/kXht6p6dZwNVX/nKzsFmxascI0jZq9DWnM2mVhyiGrkTbBY+65XOcCrn8MmU8EFsjHSS8TYeDJ18fJRub5O8oZ1OiLxF/V71nj9dY2ibfGO2G4v9mQfdh0bMuGwywAhFo6qmIzOIdgMmViM553tw1CBxC+Um2ww86sTWU4gloMOWuth2ul3hqVFgSXMjvCfTLn+wX7/i3epBcxD2KuqyacdhUSOFCVxKBgb86Ukq/5YCYFgBYtZvgNYRlq58mbTlZgEUXrAMhlZBIg6+LCLvQqJ3GwGAklj6Br9sRiKpVzBstMGcvT8k+CY5LtLyz7OnXYl2wDlKAX22OaeP8NT8Hd7FV2gcHwe1ZKTlV8grxSYVFFwaaDeRIm0uyDFz/J+hBfL4kuT3Cm+Wo3wkMaFbChS7mRmEWlrqgDxdK9FAuRej6cSE7WPfGQh+5msnYON7uUEcWoaX/l+FAg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2906002)(8936002)(40140700001)(2940100002)(86362001)(38100700002)(52536014)(33656002)(5660300002)(508600001)(186003)(122000001)(9686003)(7696005)(6506007)(66946007)(8676002)(38070700005)(66556008)(66476007)(66446008)(91956017)(64756008)(316002)(55016003)(71200400001)(786003)(110136005)(83380400001)(76116006);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 2 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?vfUpk9mhKphIM0uHzrichCfVAH5IoZt9b3f3021DDElKJUe12/1W78BVgj?= =?iso-8859-1?Q?qCx/B9uFyuPzQh6A42aWqxXYv/Fs/XnSUwLgNn4x5oK6ZAtwqDyJTLDo47?= =?iso-8859-1?Q?oGB3iLk0YJh5e5oS7mi3UM4ljwJLUAgeYDaDSWQxqX+WeQHfr31DswCAMd?= =?iso-8859-1?Q?BzAS8z5/p5PzIXTvUwfS8YMV6H4kfTbpvHNACjIJE1/s3ed8tHLfgQn4UP?= =?iso-8859-1?Q?T8hvnzukLBdYdvJX8wFXHs4O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tgTgk0ODCIdoGJED9HQzK+udDZucyDHy/4c2wpNgwXJ5IY8J7lEw/KLLdN?= =?iso-8859-1?Q?FfLEMxlMUJYlevt3FPV4F/KBNa7XPGWQdLhTFmGlrUy0zFQWtrEwf546m4?= =?iso-8859-1?Q?k2yLSTNDLrAlv9Sd+lXl3lTCs+peARbeg/r4CrCWSh0m0IQ7yEy4eUMGGZ?= =?iso-8859-1?Q?N6wBSb4rKZ3Or3AKt4U9WxjJjahJ4HcuyzgLrj6HCwygRXVsgYET/TZfl3?= =?iso-8859-1?Q?R+U9rLvcQ0gj/qSKdr5KjkjGXpgnh25d/76M77aePmx7lTi4LRo5MfiEVu?= =?iso-8859-1?Q?JpRHn4trq2RXlWha9Zf7H8mG4QvhPxUstG3lCQKj9jLcXlSekInLIjWivS?= =?iso-8859-1?Q?xJTVdKYqmLIVaqHKWlpMGP/Xdfjis2kNRxzuDe8RRjW/fn20ZHsigUdB9B?= =?iso-8859-1?Q?KKpLjDxWxw88rI3VYJr8QgveEqtHwFfLK4WQe3folKdIuS5Tkshmmrrwr9?= =?iso-8859-1?Q?cIhovb/XkGZXgwtcMSORzPxq6J4KSN+znXEv3JgrhRvbH2C9dy6aE3wUHK?= =?iso-8859-1?Q?ihQRbbYUWXTgbIkMuthiU9aog3/SW36GEiQbQD/qigLW/PJt124Rbeb7mQ?= =?iso-8859-1?Q?lfvrslRWO7Hpdd/JvC5toctTMuXtUppdnQFe3fT2od9WWIRwp5fsBA6AIa?= =?iso-8859-1?Q?iO/D8qTpKBJND7Fz58ZyJeD2Ckz/EBb7iNnzZ7y1QMa58iqVi/KnNLVX0I?= =?iso-8859-1?Q?gk?= x-ms-exchange-antispam-messagedata-1: ldnVblmvsrxhpg== Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 167ac41e-85b1-4b43-6140-08da44ae671b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jun 2022 15:41:47.0567 (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: T+ULNfIaWVwemdiJBsC0wbNwv4JcGlNVeLPf1gGZ7HKOJapvTtNby8IIxIGcKygCGlSMK1azzP/u0t3Dr4NI/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4186 X-Rspamd-Queue-Id: 4LDVcf21p2z4skx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=uoguelph.ca header.s=selector2 header.b=lkNWUosi; 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 40.107.115.70 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-5.98 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[uoguelph.ca:s=selector2]; FREEFALL_USER(0.00)[rmacklem]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_LOW(-1.00)[uoguelph.ca:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[uoguelph.ca:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[40.107.115.70:from]; NEURAL_HAM_SHORT(-0.98)[-0.981]; DMARC_POLICY_ALLOW(-0.50)[uoguelph.ca,none]; MLMMJ_DEST(0.00)[freebsd-net]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.115.70:from] X-ThisMailContainsUnwantedMimeParts: N Rick Macklem wrote:=0A= > John-Mark Gurney wrote:=0A= > > I just booted FreeBSD-current diskless, using NFS root, and I ended=0A= > > up having issues because by default, NFS root is only v2.=0A= > >=0A= > > One of things that happened was disk space available was listed as=0A= > > -138G, or -144830429K. I assume this is because the server is reportin= g=0A= > > TBs instead.=0A= > Yes. NFSv2 uses 32bit sizes.=0A= > =0A= > > If I mount via mount_nfs, the sizes are normal/correct because it mount= s=0A= > > v3.=0A= > I believe most specify "nfsv3" in the "/" mount line of /etc/fstab on the= =0A= > remote root fs. Then, when the system does a "mount -u" to make it=0A= > read/write it gets toggled to NFSv3.=0A= > =0A= > > The other issue that I ran into is that NFSv2 can't access >4GB files= =0A= > > (or create them).=0A= > As above, NFSv2 uses 32bit sizes.=0A= >=0A= > > Anyone object to adding BOOTP_NFSV3 to GENERIC?=0A= > Well, that option only works when used with BOOTP_NFSROOT.=0A= > The GENERIC configs for amd64, arm64,... use the other way.=0A= > (Just to make it confusing, there are two different ways an NFS root=0A= > fs is set up.)=0A= > See below.=0A= >=0A= > > Or maybe making it a=0A= > > tunable that defaults to set, because it seems a bit crazy to default= =0A= > > to v2 these days.=0A= > I don't think changing the default to NFSv3 will be a problem.=0A= > The reason it was NFSv2 was that,=0A= > for some non-FreeBSD NFS servers, the NFSv3 file handle is different=0A= > than the NFSv2 one.=0A= >=0A= > I added NFSv3 support to stand/libsa/nfs.c about 15years ago, so every=0A= > system should be running the newer NFS code in the loader and be able=0A= > to do NFSv3 booting.=0A= > =0A= > > This option was added in 432aad0e in 1997 so that the nfs_diskless=0A= > > structure didn't need to be filled out. Does anything even=0A= > > populate/fill it out anymore? I saw code in i386/i386/locore.s that=0A= > > does this, but it doesn't appear anywhere else.=0A= > Yes. For "options NFS_ROOT" (the other way), the loader uses=0A= > "stand/libsa/nfs.c" to acquire the remote file system's root file handle= =0A= > and fills it in. (See nfs_setup_diskless() in sys/nfs/nfs_diskless.c.)=0A= > Looking at it, it appears to enable NFSv3 so long as it finds=0A= > "boot.nfsroot.nfshandlelen" set.=0A= Just to give you a little more on how these two methods work=0A= (from my vague recollection..):=0A= options NFS_ROOT=0A= - Something (usually PXEBOOT) loaded the loader.=0A= - The loader filled in some environment variables using the code in=0A= stand/libsa/nfs.c.=0A= boot.nfsroot.nfshandle - The root fs file handle=0A= boot.nfsroot.nfshandlelen - The length of above (if not set, use NFSv2)= =0A= - plus some others to set up the network interface=0A= - The kernel uses these environment variables to fill in nfs_diskless or=0A= nfsv3_diskless. This is done by the function called nfs_setup_diskless(),= =0A= found in sys/nfs/nfs_diskless.c.=0A= =0A= options BOOTP_NFSROOT=0A= - Kernel gets loaded somehow.=0A= - Kernel uses code in sys/nfs/bootp_subr.c to get the information=0A= needed (such as the root fs file handle) via BOOTP/DHCP.=0A= For this one, it will use NFSv2 unless "options BOOTP_NFSV3" was=0A= specified along with "options BOOTP_NFSROOT" in the kernel config.=0A= =0A= If you are using the "NFS_ROOT" approach, I am surprised that you=0A= get NFSv2, since the code in stand/libsa/nfs.c appears to do NFSv3 now=0A= and sets "boot.nfsroot.nfshandlelen", unless I am mis-reading it?=0A= - Maybe you can pop out into the loader and look at the environment=0A= variables with "show"?=0A= =0A= rick=0A= =0A= > There also appears to possibly be a way via mount options, but I can't=0A= > see where it's documented to set them.=0A= I think you just specify "nfsv3" as a mount option in the root fs=0A= line in /etc/fstab on the root fs on the NFS server.=0A= =0A= I don't think changing the default to NFSv3 will be a problem.=0A= The hassle is testing the various cases, to make sure nothing=0A= breaks. I have no diskless setup to do testing and I don't even know=0A= when installs/upgrades actually replace the loader?=0A= =0A= rick=0A= =0A= --=0A= John-Mark Gurney Voice: +1 415 225 5579=0A= =0A= "All that I will do, has been done, All that I have, has not."=0A= =0A= =0A= =0A=