From nobody Wed Feb 26 14:03:33 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 4Z2x5h37Vlz5q8rL; Wed, 26 Feb 2025 14:03:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z2x5h2WD6z3tjm; Wed, 26 Feb 2025 14:03:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740578616; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=li4egja3ZojePcybNgN/Ag2/idPE4LCzTZePpzjYVVc=; b=Pssa9yUd/iT3SbA00HYDkO7TRHv16eDhAVDtzzoeYCAy1Ugi4vLSIgXxPpV5kAlNKHomC4 B6W1QqaXN+/IMhUIzL4mojGreWTA+hPeQyVClhKP2iJSdsBcLei8pMTKCgrjDia2exN8yj GIMqNnr5X5rXk1SsP8gLpN3BqFuny8c2/tfmDszcuS5Pwm4gAphK/qlkB8/nNdcK0Uh+PW TTuiC6WvhYQeRHmk4GFzbWsd5ulhZEXaHNgxHA7nUxIaT7pWYmiq2ZVARJp30HzjdVVIie o9tJdMaiOg7OfIAg1nzlaQM7Q/vncUaaNBc1W0MZciCIcKJveeQyMcd6Cy6PzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740578616; a=rsa-sha256; cv=none; b=LBvKNwZXGY5KIzpAtwQKE9YmtaQHk4Qorb1s0OOVusN3EKIA4OlABFrVHlcsNP04XkgMDh +opFPpoYKoXtgYAxB7d22HHExZPkcE1me++uRCO4077p3xgYSK7h9zAjw2V5xptmIV0txY eckQuabkUsq1T9qCUzQZ6kYygg/nR66f21CTjh7qYoMFNyU8soSoQ+F3h5Lrp3j+d8CMLc u/RitlfvAH+mdNocxgK6GZjnROonxnUS8x5EO/l4SOPGIlnDmJKCtJzLgzEVzgeiCJaZYr 7OkOHMc2AAmPq65XfIGtx2fVXlWugsLgA3odG+44fwNnNJHaYwVaewDM6xr5cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740578616; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=li4egja3ZojePcybNgN/Ag2/idPE4LCzTZePpzjYVVc=; b=mqQ+ZnyCQ/2EbRhk5ZR7BGMC5VC+bdeu+0ZWG+xcas5S8LcbM17m4jQXS3z3dTKe6IUVtN m4jbwUL/hGJWGyzWYyr4FSdIlOzKaB5RGZi+c+2xTdzpQnhC54MvylGvzkeG0y4jMK0moL +1EAgPdhc2dCX4aFM4YrmKJ5GnKX5GZnctvr4AZ6AMBZoCSYqM+ZIU+l/uTCZzov3IP+po wLPqPTw74rziwj4fYEXZZd3J2lb3H9O6yok+Amkb1JO/UyLpcBGJgSlv1E1dHqDC8JLRqL hKS8TvuiKCtN8xWamfsBsgpxMhZgRj7HEj8oQYI2btsZJ2Rif9Z4GzKwImhf8A== Received: from [10.9.4.95] (unknown [209.182.120.176]) (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 did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z2x5g5VYYzsq1; Wed, 26 Feb 2025 14:03:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Wed, 26 Feb 2025 08:03:33 -0600 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 User-Agent: Mozilla Thunderbird Subject: Re: git: e59991206b14 - main - fts(3): be less strict when automount does its job under us walking autofs mount To: Ronald Klop , Konstantin Belousov Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <985139317.7211.1740577017034@localhost> Content-Language: en-US From: Kyle Evans In-Reply-To: <985139317.7211.1740577017034@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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.