From nobody Wed Feb 26 21:13:52 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 4Z36fN1tWRz5nw3c; Wed, 26 Feb 2025 21:14:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4Z36fM4YTFz3nTr; Wed, 26 Feb 2025 21:14:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 51QLDr8s030620; Wed, 26 Feb 2025 23:13:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 51QLDr8s030620 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 51QLDqqv030619; Wed, 26 Feb 2025 23:13:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 26 Feb 2025 23:13:52 +0200 From: Konstantin Belousov To: Kyle Evans Cc: Ronald Klop , dev-commits-src-all@freebsd.org, src-committers@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount Message-ID: References: <985139317.7211.1740577017034@localhost> 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: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4Z36fM4YTFz3nTr X-Spamd-Bar: ---- On Wed, Feb 26, 2025 at 08:03:33AM -0600, Kyle Evans wrote: > On 2/26/25 07:36, Ronald Klop wrote: > > > > *Van:* Konstantin Belousov > > *Datum:* 25 februari 2025 08:20 > > *Aan:* src-committers@FreeBSD.org, dev-commits-src-all@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=e59991206b1463b7e85cc8aafde7f1dc03fcedcf > cgit.FreeBSD.org/src/commit/? > > id=e59991206b1463b7e85cc8aafde7f1dc03fcedcf> > > > > 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 file belongs to > >     automounted filesystem.  If it is, remember the updated id. > > > >     This allows the ids from the automounted volumes to change without > >     restrictions, might be a further refinement would be 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 = 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 != sb.st_dev || p->fts_ino != sb.st_ino) { > > -       errno = ENOENT;     /* disinformation */ > > -       ret = -1; > > -       goto bail; > > +       if (_fstatfs(newfd, &sf) != 0 || > > +           (sf.f_flags & MNT_AUTOMOUNTED) == 0) { > > +           errno = ENOENT;     /* disinformation */ > > +           ret = -1; > > +           goto bail; > > +       } > > +       /* autofs might did the mount under us, accept. */ > > +       p->fts_dev = sb.st_dev; > > +       p->fts_ino == sb.st_ino; > >     } > >     ret = fchdir(newfd); > >  bail: > > > > ------------------------------------------------------------------------ > > > > > > > >    /* autofs might did the mount under us, accept. */ > > > > > > I’m not native English so forgive me my question. But what does this > > comment mean? > > > > It might have triggered an autofs mount while we're running, so we just > accept the otherwise suspicious looking change. If you have a better formulation for the comment, please go ahead and commit. I did not wanted to give too formal explanation there, esp. due to the notes given in the commit message.