From nobody Tue Apr 4 09:43:17 2023 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 4PrN9d2jTgz43Hbj; Tue, 4 Apr 2023 09:43:17 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PrN9d2Cnbz3wMZ; Tue, 4 Apr 2023 09:43:17 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680601397; 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=4I9zF8b09bS8Lf7oguNP/lSKM3aMZm9kwSuTlcR8iJA=; b=C4ZyhB1d1413h/X1/vsAUVY86iPL3SikMnxGmeEuKw+TOAcXb6XYDnItiI0g9SulPljWkZ qge2SP6jN/NPej8dQQAm/zhBA0UhZ+orJYqBGmoXZcd9D+UKcHCw1tldvw3UKTLxEcHyvm JAw9uMIJ0CSglZHuCETVbznnNi5yvJeNU+hBmVHz6BW/ORajZ6KtH+pYn+TPo7EiUuxrjZ 0oVA6VOuGyhzXTHdFvOfBwPw/DU/FeKPtXtj0WMGjWdTo7DwS/JC50cYSXPtanAEoFr9C9 9cFOE/qq0+gmwT+TbHn1sucn7b0C7M7WmhJosoVuk6LHuTxRPFjNPEw0O3BxUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680601397; 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=4I9zF8b09bS8Lf7oguNP/lSKM3aMZm9kwSuTlcR8iJA=; b=RLOyjj5Cp3kL1nnjEsPsdLZz4GSw0Ulh1Zjf1YoOJ3B+0SRWwyp32BYyCn3PESuJOTVQ1s QvHt+lmpRIb3pL8NdpGtoab6F+OdM7zqhqwh5DZ0+NfwVNAdBIpOWaTYOBBlVWZKcb6iKX 3ABJ+9/NWYdrzV5zrU1Q2x58+qQoL8oHumWsUq8SeSGMWavZjn4gs5lAdhanl+bZG8d+WH YodSoNP0KOvXE+OdCG5l7zGnFFgBldgXFMmUMWpV58Gqrv6JYvjQ3Zd/X1ipN4GyzooXuC iWlxI4O3mMIx6Exh43kLrED0cPFUmsmiYRzk4uIn/ONupCRECxtcjzJzbbrhHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680601397; a=rsa-sha256; cv=none; b=gPR5OPLiqDzGKV0vxzFlQ884EcJsA9FPxwKKpADMzFy+lkONYi/ypvwsuQciF8iFfl4AVQ Uhb2WH5dwob3swFsMZc65kq+dV1zI589YzoKyunE6Lhq6BzHDNUYlT5zH28wzKKvUgQty/ 2RG3iaxwPjWACYcP/QdOq8VZYcKt7UpS1zml43UnyZWBz8d+vw1G9HNUrKy0hgIFmKtmhu 2ycDK/X2ntUgkVkgEzKXCwXo0wUactPd0H1qAIo1ikbYn5mlyQ2BNSnPgLkLFrWaLDVkIS eKZh9HnCsg9NgjkW+i5cX6LkJRFcssFosAQ2D+jIQguxtBRECKXPaceIglMg7w== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 3782D16172; Tue, 4 Apr 2023 09:43:17 +0000 (UTC) Date: Tue, 4 Apr 2023 09:43:17 +0000 From: Alexey Dokuchaev To: Poul-Henning Kamp Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 643336549081 - main - If copy_file_range(2) fails with EXDEV, use fall-back. Message-ID: References: <202304040740.3347eiU8033699@gitrepo.freebsd.org> 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202304040740.3347eiU8033699@gitrepo.freebsd.org> X-ThisMailContainsUnwantedMimeParts: N On Tue, Apr 04, 2023 at 07:40:44AM +0000, Poul-Henning Kamp wrote: > commit 64333654908153cd8e2dcb408c57cc3e3c4f29af > > If copy_file_range(2) fails with EXDEV, use fall-back. > --- > bin/cp/utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/bin/cp/utils.c b/bin/cp/utils.c > index 8c1c350ff6f1..9794152ac724 100644 > --- a/bin/cp/utils.c > +++ b/bin/cp/utils.c > @@ -180,7 +180,7 @@ copy_file(const FTSENT *entp, int dne) > if (use_copy_file_range) { > wcount = copy_file_range(from_fd, NULL, > to_fd, NULL, SSIZE_MAX, 0); Interesting. After commit c98a764c681f, which changed bufsize to SSIZE_MAX above, my ports tinderbox started to fail when copying packages and they come out zero-sized at destination. I've tried to write a simple example to reproduce it and file a PR, but the bug was evasive, so I just reverted that commit locally. May I ask how did you arrive at this fix below? Did you observe something similar, or my issue has nothing to do with it? > - if (wcount < 0 && errno == EINVAL) { > + if (wcount < 0 && (errno == EINVAL || errno == EXDEV)) { > /* Prob a non-seekable FD */ > use_copy_file_range = 0; > } ./danfe