From nobody Mon Oct 13 09:57:14 2025 X-Original-To: current@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 4clXns4188z6CHSp; Mon, 13 Oct 2025 09:57:21 +0000 (UTC) (envelope-from olce@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4clXns3TSbz3xNs; Mon, 13 Oct 2025 09:57:21 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760349441; 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:references:references; bh=dAo+P1z9A8IQfInGZCBnCv47V8GfxrfhlUB+PNAR3yU=; b=k+ECYvRJKCEGDpeNdJxHmabKXP+kjlUCaGEEopoPdjUE4oh2oSQfK+x35qh72wDnZNp8dK jUeYgdlcubY7lmoRSp7tXNXyXMXTNOPrCY9vyNZq2BsEA3j8ndmAXdDk9oxaxD7rioLCJa jMutuBJQuLqoAYPlY/1Bc5a4IAE7wsOSkszU33Uto9+n6fSz7TOzn8Pu3/2d2jEenwsol5 HGZ+LgtWK/sFN1pVKGbL/U7/wdkkAtunUFOuPpvrnNZ+2yh/eYGAwd2WZxYuna+pdXEGlx Sm2obU69F/xSLiIMTpFZXrYDnD/MeBhopafRAjT1p3YsedG6riXQ0nvba/BhOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760349441; 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:references:references; bh=dAo+P1z9A8IQfInGZCBnCv47V8GfxrfhlUB+PNAR3yU=; b=gNVoTWCKihGO4QkHJ+UT4v+EildK3wnGZUJDAylPEy++vl6heBxDuKnHQc7nKKoBK4gyXv 61pxJYQcegRb1cX1Ln1HGhH31n0FQm2ypT+Ue2b1UrpXNPL66caTQbbaeP3ru6rYZ6gRRx NtpHGUYypg14oQTlUKX3USk2Jif3efeR0XKa1OI/ZI6RzcIpsKugVJMqPE36jixxrCXo0w nK/7fk4jHc39Dg+ecD4MKHnUqsL+x77XQziG2OnXwchkys+PPU7NVMoA6Dh5iE5jV6nhFe NFW/+2O1XyrfWT0sqaLhZcWv1ZdUEe3nO1IrGZ+UIaOhv+iomElLbF72lbO5iA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760349441; a=rsa-sha256; cv=none; b=TeVYPdXKEXD3yWrYYyxn5oQu/P5eMfkWeF1lY8BFkrHlkr0yeY7RrRW4bd8Tvk1zqpDY5+ q1+6i85TAs+cDlyrtxKZ37qZJL0Ck+CuOGasbKYDZhHkWtpDsmNQgLgXRfCKKEyzBESqts XNta9RSnuzdAlawpfD0FgiOKNtDY935ai2jwwDvNt/ndIiXDqoUojuBMpMTnUR8tHvUz3v H+XP5hh8EIuUe7lcCNyys3QA0yWoEO44mb27t9qaGCsP1Z7fPiD+k/PPByO1qV9XyfNzCZ mIaLLaYRC3lSLN39ehFal73DVE4JbnLH2OneT8vmgKcRCFuhYbNHtOg5+bMXcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (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) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4clXnr6sX8z1cZ; Mon, 13 Oct 2025 09:57:20 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Lexi Winter Cc: fs@freebsd.org, current@freebsd.org Subject: Re: openat("./...", O_CREAT) fails even though the directory exists Date: Mon, 13 Oct 2025 11:57:14 +0200 Message-ID: <6142242.Zv9zXsTiuT@ravel> In-Reply-To: References: <2507674.THHZn3L5Ee@ravel> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2843477.TYJnH3iKXO"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart2843477.TYJnH3iKXO Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Olivier Certner To: Lexi Winter Cc: fs@freebsd.org, current@freebsd.org Date: Mon, 13 Oct 2025 11:57:14 +0200 Message-ID: <6142242.Zv9zXsTiuT@ravel> In-Reply-To: MIME-Version: 1.0 > - trying to create "./df59D8I2px044288", which doesn't exist, with > O_CREAT|O_EXCL fails with ENOENT. Oh, indeed, I had missed the O_CREAT|O_EXCL. I'll grab some more caffeine... > after some more debugging, i think what's going on here is that pkg(8) > is deleting and recreating /var/spool/mqueue on upgrade, which means > smmsp's open fd to that directory is no longer valid, and therefore > openat() returns this unusual error. Yes, if the directory was removed but is still open, FSes will typically return an error at lookup (which is a sub-process of creating a file there) in this directory (e.g., UFS returns ENOENT). > i suspect the fix will be in pkgbase > somewhere: for example, we could restart sendmail on upgrade, or tell > the user to do that. Most probably it will need too, yes. -- Olivier Certner --nextPart2843477.TYJnH3iKXO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmjszPsACgkQjKEwQJce JicZFxAAhoQG9zDfUsTWwPeSq+bnO0de1PpNn6XNwHzv+o0KdA84EZd0bGq8a2Wb DiOyf4TFogqUVqJ/noStHe85CGi2DlRNMLxHtsLPT/zcao3Pgxryq1L9H8ya/Tca gdbPKK7e9xzU7/hXCGWJmP0MCbIYjGEnbRiitknVaE4S64SpStDIaGqTLR38r/Cy KhZOXz5tUHoacNWVoosZ3QigUleCjhdPd0GK7fGR6qY9rGSJZE/3Q4IkARF3RToR /KTcIAmE96ThnL+ttt/0gpOwtpgJpUHkpCqqowMGx8TxEvYETI7lFeSvwEMk1MzC eJqGvKiENmAHjuFs4Qr9tPvkNm3HgV0LfWmbeMGH8DK/DZj2H8AaT7jumlKwfemn FJDvNPhtnfuMnWSCaKzI0i6W06NUzg/971EfBZXRb9yIHbO0QfLk5dyRK29ayfHH wkcY1rZgr92XghDo+e4YCdeByCESkcIkBSAACdLnVFIEm17cEvEujP+/nYtty8pC 8iiGLA31cPiT6NE1tEFMSu/B07TuGoJ85v/iQ12p83JyK7qr2PFghcV4nX7kbeD5 sjFFaxyyVw1gTMWHsWy2dTZPGI68154bkZ7+Ya1eTc7HvM/Nhv6wFParKbSErQcX +p4/O02FdZuompa+l/t88yyZR0KorMLTVyK61XcDw2Q/Ilw1DiA= =l1g3 -----END PGP SIGNATURE----- --nextPart2843477.TYJnH3iKXO--