From nobody Mon Aug 10 14:58:04 2026 X-Original-To: dev-commits-src-main@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 4hJdDG2J35z6ntyM for ; Mon, 10 Aug 2026 14:58:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 4hJdDF6y0jz3fxL for ; Mon, 10 Aug 2026 14:58:21 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-6a156627e22so6362677a12.1 for ; Mon, 10 Aug 2026 07:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786373900; cv=none; d=google.com; s=arc-20260327; b=UnVEdTTvO1T1crdON+R4dZKgqSjS1nq4JtsaTg+2+Qpz6scyVCQSrCeKd65H+Jm/ks NZYItagXhLhVtJoIVRyWsYtDNtF2Oa2Gs2lPg+l40z2zlpDe3lHr87ksqz5e7xAYMp6W OPsVcjWBFhhLenyuHAJb6S/C8cJiG4LSx2TaPSK7MrreJAV35zK5agP8ZLeqNO3rxpkS /Yvr78Ey2M805qIZw1l5yvv1MzooUQw8fiazdzwcGB0/fXZKCbjMM1sOaFMPWSOYkIU7 OaGAjiUhIn0ZJdEH9MhdOrMUDlHwMqzNfGApS0y91tI8e46xFS7fHfL36dt1Y/tIf9VM MuYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=adm2DHNKazS4LCGaj4vp6e6BkoY0e5izBmd3/rXWuqU=; fh=FTXH0Sb3jK2GIKujawVF4WPYivKRBGlTNuTMI84YNhY=; b=ZOxe8Amy6PjljeFz2A5riQ5WxwW+XvFvk29n709sh+WIMrVyzEiHsPRk98skhNONLA 72f8mtA3UxoBabSC5J/EEoNGal+Q0iydMA2hhLuOQDyICxh6Vb4yiHQB3VEYkKiqCqe0 h1LNQMvMPADnN9dMoxDRjHWG3jJhrNB6b6/w5F46IrvsRrUnTvw9nB30ybEjixHvquBd qHuy3vxGErZCMxe58dCUfyvjaaJ0tpYH0hS3QiHKFTUiG9YnZ6RiAAwgMl3KwfIuj2eS Qx9yQA46bfwv8WyaZZwu/44+zJLx1sSCOlnSn7e4G2CqacUZ2NSRyY1ZPAUleE3O+dOV POcw==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786373900; x=1786978700; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=adm2DHNKazS4LCGaj4vp6e6BkoY0e5izBmd3/rXWuqU=; b=kPCW8m4XDDA2jfeDwNM5ouLj6AqlnjuW/PvVAB1XKDX70FNTqkszTXklmZSDQtpdHR ZHPl7ZKoZZ4U4r0pibw1dEI3RPKK3qb7K1O64Kg7s0GFl+TCJG7AYVu50KmMyoNiL3jW ceeZuR7G/pUZf9iePjGKIxYwjkCiNA29BkO+9dvQ73uLKT6qMX9raxqia13vK1ir0s4O EawMfDvER4NqKo6YSBG/geaKb5itvBBn4xqQErL71azIJku0iJR0agpJ1UhmZNsmxNPv OQLCU7GfCY+SATc75gFkK0sSKqYx3vaLDrdhebgRNimg8sljDUYJ0mNUq0JFfo7sdUvk bl8g== X-Forwarded-Encrypted: i=1; AHgh+RrEUSf+QCe9q53pNwJ5zDJ5l+Ujv/AIDAgiwuA8s2p3XO9bmsTvRIvfJgsG31hvxKCPAeRrn63VC1YVjzUe7EPjIL5QYQ==@freebsd.org X-Gm-Message-State: AOJu0YwC3SWpidilctXDfYmOIjkBhYH0/f2g9kftS0yC4iHVYS87Uiwz 16/WZQUDBBrPZdxFd+nv7u0GK1Ta9DHtDIALZf1TV2pnGL2BhFr5OsA35KPgxx0ynAKVbDrTzBK 5xSx6AFZ/r4KZa0ZdAedau38LkpCIFSA= X-Gm-Gg: AR+sD103Zqn7BfOa2n1bxNAzQuVVj5wdVA1WM0GC8CqMVr9Q1DnAMtcD34UrQJolIsL Y6mmyiWo2VbWtzAcjIq8ooKNc4P1L8r2jtZ/xBfDFT9R0hSZh76p73KJgO9s9ngndKBuerS703D S6duDEP+WI2OpL4Bq7UkWCP+vofRbboCxy0x1gInUaHUTRJE0NtFCeJVGIBTk9/roxnwSdgQgv/ rL84ASLxkAbPdCm35Fm4bSAzqTaY8C8WoEk4YnLyL1/2FA2yuZ171LkZXcPE4m0FyEtoPADz2x2 iMBh/gpC1YQmkUO7l89UNDyN4QL67B2eNuCB7+eKUMLtdRYTZb2gF4ixrFTou+tTS5UnTcyhw83 41fsBReRuxtZKT8fg3RcZdL9txuHOJQSgE9sr0byH X-Received: by 2002:a05:6402:5416:b0:69f:c929:b88 with SMTP id 4fb4d7f45d1cf-6a1f4dffe2amr9204609a12.5.1786373900289; Mon, 10 Aug 2026 07:58:20 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6a70e844.251cb.6995429f@gitrepo.freebsd.org> <6870a20e-5366-486e-9405-44ad57a89bf4@FreeBSD.org> In-Reply-To: <6870a20e-5366-486e-9405-44ad57a89bf4@FreeBSD.org> From: Alan Somers Date: Mon, 10 Aug 2026 08:58:04 -0600 X-Gm-Features: AUfX_myjSFe910xMi8xvuJ_xM7Eie1yEaaJBV3z7EeYYqmuNNKkRXSs-G6ivnZw Message-ID: Subject: Re: git: 4bd01d6ae016 - main - fts: refactor to use fd-relative operations internally To: Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Jitendra Bhati , Mark Johnston Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4hJdDF6y0jz3fxL 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:15169, ipnet:209.85.128.0/17, country:US] X-Spamd-Bar: ---- On Mon, Aug 10, 2026 at 8:26=E2=80=AFAM Kyle Evans wro= te: > > On 8/7/26 10:30, Mark Johnston wrote: > > On Thu, Aug 06, 2026 at 04:52:55PM -0600, Alan Somers wrote: > >> On Tue, Aug 4, 2026 at 4:06=E2=80=AFPM Mark Johnston wrote: > >>> On Tue, Aug 04, 2026 at 01:33:40PM -0600, Alan Somers wrote: > >>>> On Tue, Aug 4, 2026 at 1:00=E2=80=AFPM Alan Somers wrote: > >>>>> > >>>>> On Tue, Aug 4, 2026 at 12:58=E2=80=AFPM Mark Johnston wrote: > >>>>>> > >>>>>> On Mon, Aug 03, 2026 at 07:13:08PM +0000, Alan Somers wrote: > >>>>>>> The branch main has been updated by asomers: > >>>>>>> > >>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D4bd01d6ae01632501b= 63438b8d9a401db9744a78 > >>>>>>> > >>>>>>> commit 4bd01d6ae01632501b63438b8d9a401db9744a78 > >>>>>>> Author: Jitendra Bhati > >>>>>>> AuthorDate: 2026-06-12 17:07:55 +0000 > >>>>>>> Commit: Alan Somers > >>>>>>> CommitDate: 2026-08-03 19:12:28 +0000 > >>>>>>> > >>>>>>> fts: refactor to use fd-relative operations internally > >>>>>>> > >>>>>>> Replace all _open() calls with _openat() in __fts_open(), ft= s_read(), > >>>>>>> and fts_children(). Replace statfs() with _fstatfs(). > >>>>>>> > >>>>>>> Add fts_dirfd to struct _ftsent, set to the file descriptor = of the > >>>>>>> parent directory. Callers can use openat(ent->fts_dirfd, ent= ->fts_name, > >>>>>>> ...) to access files safely without relying on fts_accpath, = which > >>>>>>> enables programs in capability mode to open the files descri= bed by > >>>>>>> _ftsent. > >>>>>>> > >>>>>>> This is a preparatory change for fts_openat() which will all= ow callers > >>>>>>> to provide a pre-opened directory fd, enabling fts(3) traver= sal inside > >>>>>>> Capsicum capability mode. > >>>>>>> > >>>>>>> Mirror all fts_open() changes to fts_open_b(). > >>>>>>> > >>>>>>> As a result of expanding _ftsend, publish new ELF symbol ver= sions for > >>>>>>> fts_openat and related functions. > >>>>>>> > >>>>>>> Sponsored by: Google LLC (GSoC 2026) > >>>>>>> Reviewed by: asomers > >>>>>>> Pull Request: https://github.com/freebsd/freebsd-src/pull/= 2303 > >>>>>> > >>>>>> Quite a few regression tests seem to be failing after this commit,= e.g., > >>>>>> some of the makefs tests: https://ci.freebsd.org/job/FreeBSD-main-= amd64-test/29201/ > >>>>> > >>>>> I'm testing a fix now. I should have something ready for you soon. > >> > >> The fix is committed now, as 74bd6fb1eb02 . Sorry for the trouble. > > > > Thanks, but I think there are still some problems. I'm still seeing > > vnode exhaustion while running the test suite. > > > > First, fts_build() appears to dup() the directory entry into every > > single(!) child FTS entry. That's slow and means that we'll potentiall= y > > acquire a large number of fds when traversing a wide directory, enough > > to hit per-process fd limits. Second, the return value from dup() is > > not checked, and it's not clear to me whether that's handled elsewhere. > > Finally, I'm fairly sure these dup()ed fds are leaked in various places= ; > > for instance, isn't fts_lfree() potentially leaking the dirfd of each > > entry it frees? > > > > The first and last issues are probably straightforward to fix, but I'm > > not sure about the second one. I don't think FTS can reasonably consum= e > > an fd for every entry in a directory, that's going to cause a lot of > > problems. > > > > Hi, > > Can we go ahead and back this out until the outstanding issues are > resolved, please? > > Thanks, > > Kyle Evans The "too many open file descriptors" problem should be fixed by https://github.com/freebsd/freebsd-src/pull/2360 , and I'm doing the final pre-commit testing of that PR right now.