From nobody Wed Feb 19 22:40:15 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 4YyrvP1khqz5nntW for ; Wed, 19 Feb 2025 22:40:33 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 4YyrvN1m9Cz3WM4 for ; Wed, 19 Feb 2025 22:40:32 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Az4+Mo5g; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::633 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aaf3c3c104fso61771266b.1 for ; Wed, 19 Feb 2025 14:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740004830; x=1740609630; darn=freebsd.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ztjoNmgpmHRaFEWrRetNkYwTjcbcgqNDM6OEgQ1MrGw=; b=Az4+Mo5gaePn34OYL9WyO+T5Z/XAmkurgA+30xRXFbYRmLX7RuDOy6UGQ8bJN0xGV/ yt7IR2zeaAjAoG4n0PdW/PEA5eVahqIsyG6b6mPVpRwl493ZtTpN1QsgIJlajlRM2p7y kj8bC2rOGgoHWhiL+pzOeZo7NNfshto2SnxAAYt3sWIGGoNy7UUMu2w9p//0baC526ji BkRWmdupYPzUEiXRcICBo11rWUPKafNDGrvdsW9Iw6SinDy5YcJiglYXxdWfHzQW9NiH a8H3mMKIXQLN9IXVDjX5I2qZYAcQ2uUKK+XqzHdVgBOUHnpeGFmvWqeui8jwKDZDDjeo wJGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740004830; x=1740609630; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ztjoNmgpmHRaFEWrRetNkYwTjcbcgqNDM6OEgQ1MrGw=; b=aPqbYE2wCmIXiKKhCHWiXRtTdUR6Xg+iN2iHuWr7qBDqBJfWGpE20cKHxK6prmYCE9 hUQ2OvHO6Z2J7KTpyzKao7EAE88BHGIs8HoIikEn9D6k1sDEiKm+yBGyaYHWRixZ0deP 1ifLEqohzskBj4xzTkk7fS5njnQ4LwFJlaz6CN6KuowuyEix9oWbbR5x4ByQDyBDm8G1 WKIy7PfgetjSJMVyfTTVa1YkirtmQfgUkw9J6T5KeAsfCDieRx236Kx7sW75E1D3zrUN c53N8OUZ6xxkHltcOS1QQx1gSW8DJg+wZv+ErTSmffXDsj8oQS6y7AelACWCUOTf/u+Y mLRg== X-Gm-Message-State: AOJu0Yz2r8ayH8qnBAOI1Uxs8+o8NVf73zOHewP3O7IdssGNEjFL7BXz dMYPC2hhjwEsOn4Wvh72FdwiEDL+VKn38hlS+/ODZ7HYpfchduFNR+1F6enu+Pr+0nimPNSLJtH pFBBCFYQredrCL8CQq0sCAlPJvpIg X-Gm-Gg: ASbGncuDcVSMfdrgN8S7U4AAgpmy8h6dl00ChaBenegoSqszZVGyRpZHnam9xO1/cos JK9Ju8TYgSGxZCT7+u0vzNJf+0xg63yUG7/lvOxbVqmP8OKvTU49OzqBD/Yutr2z9TXVtin8ZTf YfRbzAnjMxDMB1rKDQayq6xkRf+V8p1A== X-Google-Smtp-Source: AGHT+IF7YlPknct7i2UFE6pCa0WiHgZMTBBoHKVSIBzMeEPa9HXXOL1dePq99I+ixKAZOSo5BQ9XBCqMc2OOF0UVrgc= X-Received: by 2002:a17:906:9d2:b0:abb:6f30:32c7 with SMTP id a640c23a62f3a-abb709211e5mr1845119366b.10.1740004829969; Wed, 19 Feb 2025 14:40:29 -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 From: Rick Macklem Date: Wed, 19 Feb 2025 14:40:15 -0800 X-Gm-Features: AWEUYZln7Ca2WEZOqf1Z70KcIV9layRFT9vTnykF7lPIQmAeenREREszvg6uoZU Message-ID: Subject: RFC: mount_nfs failure due to dns not running yet To: FreeBSD CURRENT Cc: Gleb Smirnoff Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-3.98 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.982]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::633:from] X-Rspamd-Queue-Id: 4YyrvN1m9Cz3WM4 X-Spamd-Bar: --- 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.)