From nobody Thu Aug 18 21:24:30 2022 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 4M7yZQ4B1jz4ZMQ0; Thu, 18 Aug 2022 21:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7yZQ3cqyz3khL; Thu, 18 Aug 2022 21:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660857870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbopbWu7Y8J0NrYgV1NtoBB4ni7DuVBDsSRqQHWUYOM=; b=sYGe6Z/5ikXtFVltuBQHtVCuRE13LjC60ajcsSpHbb8oCV7+WuSqzzsYreJji0O833Xo4R 7ZkP/+sRR5uWzCGbIwcn5mmdznK3x6j2AzwKy68Pel2qsEFYOTh9D4VL86FsT4PiWPu4HX 6coHXEh37sQ25v7CtFwOBilxDR0Ci3vhyEGz1TB/YbjuYboXdHVUv3Bt87emCNKl5N7mcy yafK/IBSOXki8eiWzSAWqmJUcHuOPQAw/yNuea/iyyD/0JtHn7MeYe3qdJ4X8UWw6dWFQa Dqa9ayrTZrOrdQnPr4grbWmVFbqUZ0IRoYS0+HGutFed6wbPFrkIfez+yGE3mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M7yZQ2fDJzSmF; Thu, 18 Aug 2022 21:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27ILOUVh059114; Thu, 18 Aug 2022 21:24:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27ILOUpu059113; Thu, 18 Aug 2022 21:24:30 GMT (envelope-from git) Date: Thu, 18 Aug 2022 21:24:30 GMT Message-Id: <202208182124.27ILOUpu059113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 545db925c3d5 - main - pipe: fix EOF case for non-blocking fds 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 545db925c3d5408e71e21432895770cd49fd2cf3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660857870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbopbWu7Y8J0NrYgV1NtoBB4ni7DuVBDsSRqQHWUYOM=; b=e6EWLHlzXzgoVuVou0oG9KoQjrQDOhDsVvkmaZ0233Z4Y5MSn8K1xfanJ4Syzu7ufyKlRY eoZPVZ2tHkxwNSOODmiwLCSVy8yPfTH23weqZUtaOzsFvoUQKzJtjdGwUxcRmDuFy0GelM 7ZcSQS1vAH3Z9B8BlBkIuywPSZ/pIEQV1ePvj+beAanL4/E2YR4hfvqrUFjEo93F7NVJRk c4MkwCHFIEL0z3tsvI/WHfjGzImMnB6TJrB1rbAz8L38ET/6FFlgA5ODxchVq1EnliBc5L QTZj1oum5K1VdHfJ6LWqVbyReCE4+W3ehMQWBbPDVU2ROQu+P3D+n7aljjbt1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660857870; a=rsa-sha256; cv=none; b=Q38naKo5ptmgXUL3HwJXuI2ebI53aalByERqnoBQVUM2WfSrnN21DOX7+ZdiYFsOcoyrdj oiHjm1rlchdiCxycB+ivPQYoqjaTI1fhFgtJKwOMFYZkQrPNE7qtnRH0IXLweQzN597a9W E15FLEIn06VJUqdD/yzqa8B66elxMPCZpxMQpjOvvayIXwJGu+JBnbvOLYBEUwUseuTcbm WcuOuyWA5s9WpSlynHnDWK8lypqfADpouv9Dy5LkGshsz/8bcICfY08ne1eaJSdDmOhK0u r7L3qetLoj2R4oEUhflIhxumbPc9BiXbplJbxYTJpHr7eNMxZY8FeaOZO6kFOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=545db925c3d5408e71e21432895770cd49fd2cf3 commit 545db925c3d5408e71e21432895770cd49fd2cf3 Author: Mateusz Guzik AuthorDate: 2022-08-18 21:23:53 +0000 Commit: Mateusz Guzik CommitDate: 2022-08-18 21:23:53 +0000 pipe: fix EOF case for non-blocking fds In particular unbreaks 'go build'. --- sys/kern/sys_pipe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f9060ba2c8a6..67c340e9d39a 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -734,9 +734,8 @@ pipe_read(struct file *fp, struct uio *uio, struct ucred *active_cred, if ((fp->f_flag & FNONBLOCK) != 0 && !mac_pipe_check_read_enabled()) { if (__predict_false(uio->uio_resid == 0)) return (0); - if ((atomic_load_short(&rpipe->pipe_state) & PIPE_EOF) != 0) - return (0); - if (atomic_load_int(&rpipe->pipe_buffer.cnt) == 0 && + if ((atomic_load_short(&rpipe->pipe_state) & PIPE_EOF) == 0 && + atomic_load_int(&rpipe->pipe_buffer.cnt) == 0 && atomic_load_int(&rpipe->pipe_pages.cnt) == 0) return (EAGAIN); }