From nobody Wed Feb 26 13:36:57 2025 X-Original-To: dev-commits-src-all@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 4Z2wW15nV6z5q6cD; Wed, 26 Feb 2025 13:37:01 +0000 (UTC) (envelope-from SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2wW00D1Lz3fxp; Wed, 26 Feb 2025 13:36:59 +0000 (UTC) (envelope-from SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=rw2 header.b=TqoxRpJZ; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of "SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl" designates 194.109.157.24 as permitted sender) smtp.mailfrom="SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl" Date: Wed, 26 Feb 2025 14:36:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1740577017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=GoUtTbhguEC8ktm/KOi3SPUA00DMT+u9ObPodYWGu98=; b=TqoxRpJZz98DVAmFx847zfu6+vz4iIyy1gW2r8/MLRBnEgumaUsvsdwDGQhCDb+Q5iEKD4 aZl5h0bpSCuAA4iEnx9LyZUUhW17Wakb7tn5KHPMypJA8lE5+3RtHUZlh8346fIYsmvuYL yFCgad3mnKE5ksl0f+CsUWY7NiHbQd7TY5vDHeBvpjyn/8crsfQT/FTTX+rx1ewt8RXOMc 3ptGz05/3wWh+CKy7knBt6WwIgb0vOntZK9NuOciHubE66WNwHWY60omippBO991p/KwZC UtWx36K1bkCZqtlCI/W00fJt50dDf9ae7PIDQsVtFsRsqfFDZ06yXQaNs6YlIA== From: Ronald Klop To: Konstantin Belousov Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <985139317.7211.1740577017034@localhost> In-Reply-To: <202502250720.51P7KJkI056048@gitrepo.freebsd.org> Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7210_1760650439.1740577017031" X-Mailer: Realworks (739.null) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Result: default: False [-0.28 / 15.00]; RBL_SENDERSCORE_REPUT_9(-1.00)[194.109.157.24:from]; NEURAL_SPAM_LONG(0.96)[0.962]; NEURAL_HAM_SHORT(-0.83)[-0.831]; NEURAL_SPAM_MEDIUM(0.69)[0.692]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; FORGED_SENDER(0.30)[ronald-lists@klop.ws,SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl]; R_SPF_ALLOW(-0.20)[+ip4:194.109.157.0/24]; R_DKIM_ALLOW(-0.20)[klop.ws:s=rw2]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ONCE_RECEIVED(0.10)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.109.157.24:from]; RCVD_COUNT_ZERO(0.00)[0]; RCPT_COUNT_THREE(0.00)[4]; FROM_NEQ_ENVFROM(0.00)[ronald-lists@klop.ws,SRS0=9B21=VR=klop.ws=ronald-lists@realworks.nl]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; HAS_X_PRIO_THREE(0.00)[3]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[klop.ws:+] X-Rspamd-Queue-Id: 4Z2wW00D1Lz3fxp X-Spamd-Bar: / ------=_Part_7210_1760650439.1740577017031 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Van: Konstantin Belousov Datum: 25 februari 2025 08:20 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commi= ts-src-main@FreeBSD.org Onderwerp: git: e59991206b14 - main - fts(3): be less strict when automoun= t does its job under us walking autofs mount >=20 >=20 > The branch main has been updated by kib: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De59991206b1463b7e85cc8aafd= e7f1dc03fcedcf >=20 > commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf > Author: Konstantin Belousov=20 > AuthorDate: 2025-02-21 13:07:43 +0000 > Commit: Konstantin Belousov=20 > CommitDate: 2025-02-25 07:09:29 +0000 >=20 > fts(3): be less strict when automount does its job under us walking a= utofs mount > =20 > Namely, allow the file id change if the resulting file belongs to > automounted filesystem. If it is, remember the updated id. > =20 > This allows the ids from the automounted volumes to change without > restrictions, might be a further refinement would be to only allow su= ch > inconsistency once. > =20 > PR: 284914 > Reported and tested by: Lexi Winter=20 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D49094 > --- > lib/libc/gen/fts.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c > index 770a7b2cc322..bd193c7c6cfc 100644 > --- a/lib/libc/gen/fts.c > +++ b/lib/libc/gen/fts.c > @@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char= *path) > { > int ret, oerrno, newfd; > struct stat sb; > + struct statfs sf; > =20 > newfd =3D fd; > if (ISSET(FTS_NOCHDIR)) > @@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, cha= r *path) > goto bail; > } > if (p->fts_dev !=3D sb.st_dev || p->fts_ino !=3D sb.st_ino) { > - errno =3D ENOENT; /* disinformation */ > - ret =3D -1; > - goto bail; > + if (_fstatfs(newfd, &sf) !=3D 0 || > + (sf.f_flags & MNT_AUTOMOUNTED) =3D=3D 0) { > + errno =3D ENOENT; /* disinformation */ > + ret =3D -1; > + goto bail; > + } > + /* autofs might did the mount under us, accept. */ > + p->fts_dev =3D sb.st_dev; > + p->fts_ino =3D=3D sb.st_ino; > } > ret =3D fchdir(newfd); > bail: >=20 >=20 >=20 >=20 >=20 /* autofs might did the mount under us, accept. */ I=E2=80=99m not native English so forgive me my question. But what does thi= s comment mean? Regards, Ronald.=20 ------=_Part_7210_1760650439.1740577017031 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Van: Konstantin Bel= ousov <kib@FreeBSD.org>
Datum: 25 februari 2025 0= 8:20
Aan: src-committers@FreeBSD.org, dev-commits-src-a= ll@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: e59991206b14 - main - fts(3): be less strict when automount does= its job under us walking autofs mount

The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=3De5999120= 6b1463b7e85cc8aafde7f1dc03fcedcf

commit e59991206b1463b7e85cc8aafde7f1dc03fcedcf
Author:     Konstantin Belousov
AuthorDate: 2025-02-21 13:07:43 +0000
Commit:     Konstantin Belousov
CommitDate: 2025-02-25 07:09:29 +0000

    fts(3): be less strict when automount does its job = under us walking autofs mount
    
    Namely, allow the file id change if the resulting f= ile belongs to
    automounted filesystem.  If it is, remember th= e updated id.
    
    This allows the ids from the automounted volumes to= change without
    restrictions, might be a further refinement would b= e to only allow such
    inconsistency once.
    
    PR:     284914
    Reported and tested by: Lexi Winter
    Sponsored by:   The FreeBSD Foundation     MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D49094
---
 lib/libc/gen/fts.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 770a7b2cc322..bd193c7c6cfc 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1132,6 +1132,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *= path)
 {
    int ret, oerrno, newfd;
    struct stat sb;
+   struct statfs sf;
 
    newfd =3D fd;
    if (ISSET(FTS_NOCHDIR))
@@ -1144,9 +1145,15 @@ fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char = *path)
        goto bail;
    }
    if (p->fts_dev !=3D sb.st_dev || p->fts_ino != =3D sb.st_ino) {
-       errno =3D ENOENT;    &= nbsp;/* disinformation */
-       ret =3D -1;
-       goto bail;
+       if (_fstatfs(newfd, &sf) !=3D 0 |= |
+           (sf.f_flags &= amp; MNT_AUTOMOUNTED) =3D=3D 0) {
+           errno =3D ENO= ENT;     /* disinformation */
+           ret =3D -1; +           goto bail; +       }
+       /* autofs might did the mount under u= s, accept. */
+       p->fts_dev =3D sb.st_dev;
+       p->fts_ino =3D=3D sb.st_ino;
    }
    ret =3D fchdir(newfd);
 bail:




   /* autofs might did the mount under us, a= ccept. */


I=E2=80=99m not native English = so forgive me my question. But what does this comment mean?

<= /div>
Regards,
Ronald. 


------=_Part_7210_1760650439.1740577017031--