From nobody Wed Nov 27 03:09:56 2024 X-Original-To: freebsd-stable@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 4Xykvl3rBwz5fRPH for ; Wed, 27 Nov 2024 03:10:11 +0000 (UTC) (envelope-from mike@jellydonut.org) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 4Xykvj6dzpz3yDZ for ; Wed, 27 Nov 2024 03:10:09 +0000 (UTC) (envelope-from mike@jellydonut.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jellydonut.org header.s=google header.b="Ct3hK8/p"; spf=pass (mx1.freebsd.org: domain of mike@jellydonut.org designates 2a00:1450:4864:20::331 as permitted sender) smtp.mailfrom=mike@jellydonut.org; dmarc=pass (policy=none) header.from=jellydonut.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434a1095fe4so2850045e9.1 for ; Tue, 26 Nov 2024 19:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jellydonut.org; s=google; t=1732677008; x=1733281808; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HXNfxnKGfTDVRvA1mC9UspomMBmj70TDUcKHoYGwXZI=; b=Ct3hK8/p4JgMpYBwDBYFcxsF3UStXYtVmApoMZA2WB3F8dIiM/Wh4Z4NRqsw1txK4h PqF5g3D64aUZ0+r+REFUyw2nK8rKCCtS7lFdFhWOUz/i6IAL7mLz+Od5LdpazxQBzqbK WIs50Y0eR4DoX3fNaJkVM7XhDHK26bzl4CDh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732677008; x=1733281808; h=content-transfer-encoding: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=HXNfxnKGfTDVRvA1mC9UspomMBmj70TDUcKHoYGwXZI=; b=rAG3xMg4Y9lNtFHXYfhDhQIpkEYBCFoHQBRfJFuERN08dSh8x3P+y/34au5VCe9w0w tbDtQPIjj9C/S6mJ+tS+lCwMWZGcZ0VG9zGJgsBt2YhgeuIPTDEM2T2Iek9ILl/STCXf R90rpgpVPXM8ZzVn36tqwOuOvwC14MJy3tukb2q56gXqed6ujsSTbh60CSQevYwO9VcJ JFVQ3bDE6n8cy0ugPOJRt3HqavkHbJy1NmwiVS8M0km+v6WLkliQLPr9JcKTVexd2kvv nhYYNp3YztmNrGuHPro7g5KZRfW6AY5gFl20L3NOxlA18exomDkQMtd4odCjSfov+La/ uUlw== X-Gm-Message-State: AOJu0Ywt4wqdg7Xe5l/MCQAzpFSGiAWpd4QKXs8OgRbGWmaaQBT5o2vx 04tEC+o2tDFjdEgRWvp4i8Q9ilfSQvBzxcbMfn/uQLhJBRSOsFymKTOK3tNdClGMDAA6QPLogFT RNSDBQNEYBzQT9DIgFdRYt4+G1kSqNJU2uTZiwz4QNEQYPVGGcA== X-Gm-Gg: ASbGncvIO3EV7K8xqQLBCB6EKh72w5j4cAVe8B1GrxNrBwUghXVhMLq2P4wrUOF1zat KhEaCyhtzKkzfmNxIv48F3LIhXyukBTIMst7EEPxnyfmYjQ== X-Google-Smtp-Source: AGHT+IEHL8RSAoA1Jv643cbdnzWrcxZrrodG0FQknn4w6MVpX/t5kl43rmHzKB2WkKacyo6iidgrzIaZC9UNDiEEGJU= X-Received: by 2002:a5d:6da8:0:b0:382:3c7b:9b2 with SMTP id ffacd0b85a97d-385c6edb860mr305036f8f.14.1732677007678; Tue, 26 Nov 2024 19:10:07 -0800 (PST) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Michael Proto Date: Tue, 26 Nov 2024 22:09:56 -0500 Message-ID: Subject: Re: 14.1 NFS / mountd : -alldirs not working as expected To: Rick Macklem Cc: FreeBSD-STABLE Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[jellydonut.org,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[jellydonut.org:s=google]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FREEFALL_USER(0.00)[mike]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::331:from]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TAGGED_RCPT(0.00)[]; TO_DN_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[jellydonut.org:+] X-Rspamd-Queue-Id: 4Xykvj6dzpz3yDZ X-Spamd-Bar: --- On Tue, Nov 26, 2024 at 11:01=E2=80=AFAM Rick Macklem wrote: > I dug into the git repository and, believe it or not, it looks like this = was > broken between releng1.0 and releng2.0 (there doesn't seem to be an > exact commit). > > Basically, for releng1.0 the path provided by the exports line was passed > into mount(2), which would fail if the path was not a mount point. > This was how "not at a mount point" was detected for -alldirs. > > For releng2.0, it passes f_mntonname to mount(2), which is the > mount point. This broke the check for "is a mount point". > To be honest, the while() loop calling nmount(2) is mostly > (if not entirely useless), because its purpose was to climb the path > to the mount point and this should never now happen. > > I do have a patch that detects "not a mount point" using a strcmp() > between f_mntoname and the path in the exports line. > That should be sufficient, since symbolic links should not be in > the path in exports(5). > > Michael, once you create a bugzilla bug report (bugs.freebsd.org), > I will attach the patch and work on getting it committed. > > rick > > > > > rick > > > > > > > > > > /etc/rc.conf : > > > > nfs_server_enable=3D"YES" > > > > rpcbind_enable=3D"YES" > > > > rpc_statd_enable=3D"YES" > > > > rpc_lockd_enable=3D"YES" > > > > mountd_enable=3D"YES" > > > > > > > > /etc/exports : > > > > /cdrom -alldirs,quiet,ro -network=3D10.0.0.0/24 > > > > > > > > (at this time /cdrom exists as a directory but is not currently a > > > > filesystem mount point) > > > > on the server: > > > > root@zfstest1:~ # killall -HUP mountd > > > > > > > > /var/log/messages: > > > > Nov 20 22:34:56 zfstest1 mountd[27724]: Warning: exporting /cdrom > > > > exports entire / file system > > > I took a closer look and this is a bug. It appears that -alldirs is s= upposed > > > to fail when a non-mountpoint is exported. > > > > > > It appears to have been introduced to the system long ago, although I > > > haven't yet tracked down the commit. > > > > > > mountd.c assumes that nmount(8) will fail when the directory path > > > is not a mount point, however for MNT_UPDATE (which is what is > > > used to export file systems) this is not the case. > > > > > > Please create a bugzilla bug report for this and I will work on a pat= ch. > > > > > > Btw, quiet is also broken in the sense that it will cause any nmount(= 8) > > > failure to fail. However, since nmount(8) does not fail for this case= , > > > it hardly matters. I will come up with a patch for this too, since it= is > > > easy to fix. > > > > > > Thanks for reporting this, rick https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282995 Thank you for digging deeper into this! Had no idea it was that much of a legacy situation, beats my introduction to FreeBSD by 2 releases. -Michael Proto