From nobody Thu Feb 20 00:25:20 2025 X-Original-To: freebsd-current@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 4YyvDY12ksz5nvg0 for ; Thu, 20 Feb 2025 00:25:33 +0000 (UTC) (envelope-from drsnx60@gmail.com) Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YyvDX1Bvyz3hpq for ; Thu, 20 Feb 2025 00:25:32 +0000 (UTC) (envelope-from drsnx60@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=M0clCxuh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of drsnx60@gmail.com designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=drsnx60@gmail.com Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2fc33aef343so761030a91.1 for ; Wed, 19 Feb 2025 16:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740011131; x=1740615931; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6Bk6H/2jP0x3rMCbmAvFMwpYE5eVbN1r1hQzcnPZ5Mk=; b=M0clCxuhduBmyWCgFxagNihhCUdyVeP4u7EPJY8RItBbtXaLW7Y8sxMXF3lxEChMOH 0XzzfadS062Su6JxjyLILuYV2uyEtbxk1MmW+ImY6t8RRfGFQqxC5WeQfG32tFL8LQEl pbcJE6OuXb54v1Vf9p8K9SARYMX3MBzYG+qtEJWCVS04f1CyqIk8Q0qyeOaYV5HXyLOy 0CJdJg8YvPaC/yY54aWvSTP7vNn4ycLGBphIa/fWNC4SG2l9zK0a09J7LMu83amhhVWv L94MpUY8D3BxGzkqNzbdPdut3Wu7757LQLEmxQbTVDHERXEv9izO1Gu+p474UYBs41tz jyPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740011131; x=1740615931; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6Bk6H/2jP0x3rMCbmAvFMwpYE5eVbN1r1hQzcnPZ5Mk=; b=s6QwFm4mLhREDSrky7Y7bH0XAplS18iv69XMqtNQf1wZfSG0BKtK8LFglOWQGiCGDC XC5f3/LkpLu07GMxllJ8hglz/2KOBi0UZXAH8obutug8FQlnuN7UKM19H/GZhh0V8r/Q O18dPL4yNWE7ATOjEEq8P5HqrhDkv7rBeStZj4twsZRnuGEngEB92HPQJT0W640zF760 7cJLUj1/2C3h5ra2cxYot3BsW4XroFDcDuyVBK6u3HC60jZdUen68p1QyotMNvb9JHka Dm4Y4UeDW1eohYfglYa95joA9JaCY22XN8VLEWKR33XHjeGwwkz3Ze6vJ30Q+GBO9n9X nCXA== X-Gm-Message-State: AOJu0YybIvzRzyBcUYhPcMI3ttoVEqqmP/WeLnEV2lUTQDfIk62GdF+B CezUrYFu4PDE7RuxjdGbcEnh25x8RRlJJsWUfrYpdOFiKQQP2fqDUzdO+b+SuR45InTSxeVNrEX PrE1Z7lg2OmcQNN971LjOaRZNXk4= X-Gm-Gg: ASbGncuWFa7BK8GvPhJ5hEiUN0nlc7nBpo4iOInSHkVDf26OP0wC5f227gZ7UgsyBcR u1d2AlZ7enkk1AowNNRDBiv4+IXXCoLV5cOzxJlJ2Hm9AGZNIanRgZzkRIcWumn3NveKPw1Q= X-Google-Smtp-Source: AGHT+IGsYxWdYgq73u6JdHcb7hcFg5lTZyrz5eWd/HA08yUshxG2Mbk9RF+1eWvso0nMJYdLZczYPVqgTgxqEPFPYYI= X-Received: by 2002:a17:90b:520d:b0:2ee:f687:6adb with SMTP id 98e67ed59e1d1-2fcb59ec21dmr8393721a91.3.1740011130792; Wed, 19 Feb 2025 16:25:30 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Lars Tunkrans Date: Thu, 20 Feb 2025 01:25:20 +0100 X-Gm-Features: AWEUYZmiOSnofvHmL-LsuH6FgqnLks4LE_M9netdeokGiMQvk7BtLKeYNlRVUCE Message-ID: Subject: Re: RFC: mount_nfs failure due to dns not running yet To: Rick Macklem Cc: FreeBSD CURRENT , Gleb Smirnoff Content-Type: multipart/alternative; boundary="0000000000005b3956062e87e9f2" X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1029:from]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4YyvDX1Bvyz3hpq X-Spamd-Bar: --- --0000000000005b3956062e87e9f2 Content-Type: text/plain; charset="UTF-8" This situation has existed these past 40 years. You have to put your ipadress : hostname pairs into /etc/hosts if you dont have accsss to a working DNS. This is not a bug. Its the way name resolution works. Den ons 19 feb. 2025 23:40Rick Macklem skrev: > Hi, > > The subject line basically describes the problem glebius@ > ran into. When doing an NFS mount in /etc/fstab, it failed > since the DNS service was not yet working and, as such, > the DNS lookup of the server fqdn failed, causing the mount > to fail. Note that this behaviour has existed for decades. > > He feels this is a bug and that mount_nfs(8) should retry > getaddrinfo(3) calls until success, instead of failing the > mount when the first attempt fails. > The problem with just retrying getaddrinfo(3) is that it > could retry forever for simple failures like a typo in the > server fqdn. > I can see several ways this can be handled and would > like feedback from others w.r.t. these alternatives. > > 1) Simply document this case and encourage use of > host names in /etc/hosts for NFS servers along with > specifying use of file before dns in nsswitch.conf. > Doing this results in the mounts working whether or > not DNS is working. > > 2) Call it a bug and patch mount_nfs(8) to retry getaddrinfo(3) > until it succeeds. (I feel this would be a POLA violation, > given that the current behaviour has existed for decades > and for simple cases where the fqdn will never resolve > the behaviour would be to hang at the mount attempt > during boot unless "bg" is specified for the /etc/fstab entry.) > > 3) Add a new NFS mount option "retrydns=", which would enable > retries of getaddrinfo(3). This would avoid any POLA violation and > would allow for a convenient way to document the behaviour in > "man mount_nfs". > > 4) ??? > > So, what do you think is the preferred change? > > rick > ps: I looked and the return value from getaddrinfo(3) does not > appear to be useful to discern the case of "DNS service not > running yet". (I think it replies EAI_FAIL for this case.) > > --0000000000005b3956062e87e9f2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

This situation has existed these past 40 years.=C2=A0 You ha= ve to put your ipadress : hostname pairs into /etc/hosts=C2=A0 if you dont = have accsss to a working DNS.=C2=A0=C2=A0=C2=A0 This is not a bug.=C2=A0 It= s the way name resolution works.


Den ons 19 feb. 2025 23:40Rick Macklem <rick.macklem@gmail.com> skrev:
Hi,

The subject line basically describes the problem glebius@
ran into.=C2=A0 When doing an NFS mount in /etc/fstab, it failed
since the DNS service was not yet working and, as such,
the DNS lookup of the server fqdn failed, causing the mount
to fail. Note that this behaviour has existed for decades.

He feels this is a bug and that mount_nfs(8) should retry
getaddrinfo(3) calls until success, instead of failing the
mount when the first attempt fails.
The problem with just retrying getaddrinfo(3) is that it
could retry forever for simple failures like a typo in the
server fqdn.
I can see several ways this can be handled and would
like feedback from others w.r.t. these alternatives.

1) Simply document this case and encourage use of
=C2=A0 =C2=A0 host names in /etc/hosts for NFS servers along with
=C2=A0 =C2=A0 specifying use of file before dns in nsswitch.conf.
=C2=A0 =C2=A0 =C2=A0Doing this results in the mounts working whether or
=C2=A0 =C2=A0 =C2=A0 not DNS is working.

2) Call it a bug and patch mount_nfs(8) to retry getaddrinfo(3)
=C2=A0 =C2=A0 =C2=A0until it succeeds. (I feel this would be a POLA violati= on,
=C2=A0 =C2=A0 =C2=A0given that the current behaviour has existed for decade= s
=C2=A0 =C2=A0 =C2=A0and for simple cases where the fqdn will never resolve<= br> =C2=A0 =C2=A0 =C2=A0the behaviour would be to hang at the mount attempt
=C2=A0 =C2=A0 =C2=A0during boot unless "bg" is specified for the = /etc/fstab entry.)

3) Add a new NFS mount option "retrydns=3D<N>", which would= enable
=C2=A0 =C2=A0 retries of getaddrinfo(3). This would avoid any POLA violatio= n and
=C2=A0 =C2=A0 would allow for a convenient way to document the behaviour in=
=C2=A0 =C2=A0 "man mount_nfs".

4) ???

So, what do you think is the preferred change?

rick
ps: I looked and the return value from getaddrinfo(3) does not
=C2=A0 =C2=A0 =C2=A0 appear to be useful to discern the case of "DNS s= ervice not
=C2=A0 =C2=A0 =C2=A0 running yet". (I think it replies EAI_FAIL for th= is case.)

--0000000000005b3956062e87e9f2--