From nobody Tue Aug 30 15:02:08 2022 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 4MH9Wj6DfZz4ZgMQ; Tue, 30 Aug 2022 15:02:09 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-YQB-obe.outbound.protection.outlook.com (mail-yqbcan01on2045.outbound.protection.outlook.com [40.107.116.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MH9Wj5dK7z3v9Q; Tue, 30 Aug 2022 15:02:09 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hlH8QpD0lKQEX6ZgCRP/UsN38uboKFUcmPz+zO//f4FBaxb5oFRRRJRMPNEgzwpHGk9SU0A71XHwqeGC3+kLt6GzijNm8HqwwCNo1vUQt67gX7QOwPCKA7vTXpQx5+n0SWigJEExWKjLn8oRwEN9TKABI56IdD21LvrnyziAjaTxoO/IUfrTyK1swOjZfJtk8pHTUzkty4/jXhTkM+KRgtRJ6+RrhwOqCc8fL0cNlQAKqF2jVByRr9qMu/rCKvw2Y4FvgCsstW9OFwuhyJgAPNkFNa1ZHsVY1YjYz43rdE09CXyP1LUkkbV3N7SGFB8WVs/vWZX2ROTF9r84IyR63w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B7sbd7oO5SZkiRnSkT+Gh9cOprsQtob1xq8mKvYIenc=; b=cBmzyD4y9PkTksu7dKXHsjZEFEvKR3bkvCCVZyo5tNaTPZl7f+yIu3SnYkuDf2ILo5IvPRyug0NI+ZysrMXThqHKN6abdIAJ1JBOBtkagRkHdsEOsgjChs1M8YEiU+9ZF63LMYDAagzASHVqN4bPiMFEnCCWYxImFbjb2buLLPal/emJOdAxJRfkqa9mNxQsU1+68VP9wYjGZ8fGIVsOup3C1v2iqejZhSv9yJW7mggfEhYmcxa3XNtMmBTHR9qOK0dg9qbaq9JRV0VF36IThwKanAbvEIW46JOeHUnyfOdvH8rpzZcpxls9510o16Qp8S8l74MwsjGeTNb0T307Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B7sbd7oO5SZkiRnSkT+Gh9cOprsQtob1xq8mKvYIenc=; b=UtVQcO4zoxNf1eqTwqxJ9uCDotMU39gn5v3RlszmsYQlMjTjAeRN9294pcCudRdJARZVcP29G29qwFkG7VZ2tXz5D0qUfBMl6T6LUXa7c+ruAaceQKs7xIejfueQ9rolSKDajKuJLbCN6mN0YsDDn7ksVv+UWcOL40PmuV6XD4aa94W3rv1wu2y0pxmDJWFHb8KbrzSYrnZRef/P3eYJGq76YOXXKoR2Hruh77zRqP0s4ZowcRgGVpxlSzm8hwnRVhruH5HbXnFPncAHhK8YLl3Um9rqTyJEiuZypU4ZmOo05N+4+yevBsTLfUDmqgDN1ZHkB2FffpSAWg9nLJpksg== Received: from YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:6::7) by YQBPR0101MB4428.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:17::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Tue, 30 Aug 2022 15:02:08 +0000 Received: from YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM ([fe80::980d:23ea:9bc2:9f37]) by YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM ([fe80::980d:23ea:9bc2:9f37%9]) with mapi id 15.20.5588.010; Tue, 30 Aug 2022 15:02:08 +0000 From: Rick Macklem To: Mateusz Guzik , Alexander Motin CC: "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" Subject: Re: git: 35b7759c05cb - main - cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. Thread-Topic: git: 35b7759c05cb - main - cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. Thread-Index: AQHYvIBVkyWh0RTCA02Oxy3neY+KA63HiPSAgAAATzw= Date: Tue, 30 Aug 2022 15:02:08 +0000 Message-ID: References: <202208301453.27UEroGr037461@gitrepo.freebsd.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aaf53fb5-2d83-4dba-e7e7-08da8a989bfe x-ms-traffictypediagnostic: YQBPR0101MB4428:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AaB/JdoIQXptHZOpXfhAD/YcJNpvQ7CkUdptXSDXHMcCe+gPzrei3YnQz9ktl2dno6OZE/V31CkgaK/3bB0vJzC1/Qqnyl0JXQGVR/kmYcqp5bVfO8MBIpcm9PH/L0TWv4fdT4BgXBFcTv2JyrJ4fsUWvk/kaNWQNMCXyPlNKlV58z0MpUfDnOh1X5vGYU87AFPBbInk455Pniy59UCWyLL9dZgnbWDk+fm105asw5Y0wFyXiiXt9hKuqJ458Y9Aq8b9zDDodaYXfMywL4INFVmu/sxErJA1IQnFRE+FrtREJmfkBNpa3LEm1zSV803m4tyat/FBd/WtVdYjMSh8Yd8VImFdps5MulAKbNs1HT4bCVl+MmEFzuYV74LzUkeSG8cleQyqI6Cj/ZL2a8/bplEujvUusf2zX2pApbcRLmDfES3W2kwsh/7koqrivly+oSgbvb1y9RVwYBgVdyFMvZkmGi96VEWuXSdECIvW3J5Hj+uRUUfsNQipyToEUqCdPlnY2dWMt8kRc81kDMnzLGSn7V6yKg6mrkEjFvAnJIqN6OW5paBidzBo6yfeXsixx0T3frUvwdgZkGlZb7zcY4/IJfGpI3SHddzUCmgDXMDkcx06qELMXiA/6Ch0Lg0Dp4pTXMlwOnJ8o/SupOB3F+r21BwA0aipUknz6pzMQVV1aw7mbDmqO54FJSIYudjV14+0c417cdW6dkcHG4Q7EBOJpUi2Vnm/IGGkopvs5zSnGzr/T07+Vm84soXBkHn3oHKVJMYmLzJfxYhmyCC6Nwq24KWoN8jbfkZQlwHd5Ls= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(66556008)(5660300002)(110136005)(66946007)(54906003)(8676002)(64756008)(52536014)(8936002)(4326008)(66446008)(66476007)(41320700001)(33656002)(76116006)(2906002)(316002)(786003)(91956017)(55016003)(966005)(478600001)(41300700001)(7696005)(6506007)(9686003)(71200400001)(86362001)(38070700005)(83380400001)(186003)(122000001)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?+bbZoB/KwgnesX03xhsC7lK4NnMOP50HvJeikkt4chVj0kkOrS97GK4XwG?= =?iso-8859-1?Q?p0vLeGazR0l6n5gLlB6qWG2HA9/EZprmi2YsVHCUgxjgA7V6/KQrl8xp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HpAAG7wZZelYWVnYK9aCcZmz?= =?iso-8859-1?Q?+EaonMO8WeJuOlStLaRCDqXYRdoqcJtiVaPN/YiGTo5rgFIsgA23T4GHx4?= =?iso-8859-1?Q?4XTouRmvHJartRY4km0JVoMkO7iaxQoWLVBBNfl2VGk7k8bGUPUC/NOa4n?= =?iso-8859-1?Q?kPyUkXmFyy3gURPa0wzhIB/P7qTZY0RH6W1KZvYAT3cRB/qgLiSc+dmPe/?= =?iso-8859-1?Q?P4CYZkStjL+3c1QMkEQ1W1cHTpqsoG/cIVLsi/3xUZwUkZiAQuvxnDuX9K?= =?iso-8859-1?Q?6GX6o4ojWLETOVbPvoFFdNzqW07pX48O7ZBt6gy/sQkqg3aSnBY6gu/eQz?= =?iso-8859-1?Q?XCC8Ybf0EHkn/3sasz9VJxFUMhBotV1YBQWwGBCTEpeif3Cy6mJXrPtFK6?= =?iso-8859-1?Q?goU25M3zd68Qiv5QNaqTjFWnyfGMb8Xbh3LTdiD++RGOuvEwuSFcby8wv7?= =?iso-8859-1?Q?zmy4alFZAZ5LtHec8Znx7zHePwISDyhHSGjNKen+1oJTbuGpdEfFck+j6W?= =?iso-8859-1?Q?20ZrPUw8a4qONDMCMeKfvZ8Uour8nFOfumUsFDezw6gueIl7ESic5sY5sX?= =?iso-8859-1?Q?cPPM7jS3kgurLhvQM9VwVLl2VV6lBsxbP2RlACblSreJLSWYG3vZzu2cQd?= =?iso-8859-1?Q?aclJMFvZsa32PbTFwJCEvKQUREiMZqtz9YIIOcWCxxMWssuPk7IDa0URum?= =?iso-8859-1?Q?H+UOPcpo5WDWd3RqfiwGgiqXG9gUmIHb8BquSb/1?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: aaf53fb5-2d83-4dba-e7e7-08da8a989bfe X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2022 15:02:08.2870 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P90HQXX7Ni4aKCTG6WllrGknghOqGZQ3zBE+RCUFs/WLLYjB8y0RaaFd77WBrPup8p/RvqXBx+mHsxtKpbQ55Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB4428 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4MH9Wj5dK7z3v9Q 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)[] X-ThisMailContainsUnwantedMimeParts: N Mateusz Guzik wrote:=0A= > On 8/30/22, Alexander Motin wrote:=0A= > > The branch main has been updated by mav:=0A= > >=0A= > > URL:=0A= > > https://cgit.FreeBSD.org/src/commit/?id=3D35b7759c05cbc65c06d87141da79f= 0f80af0f458=0A= > >=0A= > > commit 35b7759c05cbc65c06d87141da79f0f80af0f458=0A= > > Author: Alexander Motin =0A= > > AuthorDate: 2022-08-30 14:51:21 +0000=0A= > > Commit: Alexander Motin =0A= > > CommitDate: 2022-08-30 14:51:21 +0000=0A= > >=0A= > > cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED.=0A= > >=0A= > > It allows to not use mmap() for small files, which is not helpful= =0A= > > in case of ZFS. Should be no functional change.=0A= > >=0A= > =0A= > This should be of no use thanks to copy_file_range=0A= cp does not use copy_file_range(2) for small files, if I recall correctly.= =0A= =0A= rick=0A= =0A= > MFC after: 1 week=0A= > ---=0A= > bin/cp/utils.c | 19 +++++++++----------=0A= > 1 file changed, 9 insertions(+), 10 deletions(-)=0A= >=0A= > diff --git a/bin/cp/utils.c b/bin/cp/utils.c=0A= > index e7ae0c9dd733..07de0495ba9e 100644=0A= > --- a/bin/cp/utils.c=0A= > +++ b/bin/cp/utils.c=0A= > @@ -99,13 +99,12 @@ copy_file(const FTSENT *entp, int dne)=0A= > static char *buf =3D NULL;=0A= > static size_t bufsize;=0A= > struct stat *fs;=0A= > - ssize_t rcount, wcount;=0A= > - size_t wresid;=0A= > + ssize_t wcount;=0A= > off_t wtotal;=0A= > int ch, checkch, from_fd, rval, to_fd;=0A= > - char *bufp;=0A= > #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED=0A= > - char *p;=0A= > + size_t wresid;=0A= > + char *bufp, *p;=0A= > #endif=0A= > int use_copy_file_range =3D 1;=0A= >=0A= > @@ -234,18 +233,18 @@ copy_file(const FTSENT *entp, int dne)=0A= > wtotal =3D 0;=0A= > do {=0A= > if (use_copy_file_range) {=0A= > - rcount =3D copy_file_range(from_fd,= NULL,=0A= > + wcount =3D copy_file_range(from_fd,= NULL,=0A= > to_fd, NULL, SSIZE_MAX, 0);=0A= > - if (rcount < 0 && errno =3D=3D EINV= AL) {=0A= > + if (wcount < 0 && errno =3D=3D EINV= AL) {=0A= > /* Prob a non-seekable FD *= /=0A= > use_copy_file_range =3D 0;= =0A= > }=0A= > }=0A= > if (!use_copy_file_range) {=0A= > - rcount =3D copy_fallback(from_fd, t= o_fd,=0A= > + wcount =3D copy_fallback(from_fd, t= o_fd,=0A= > buf, bufsize);=0A= > }=0A= > - wtotal +=3D rcount;=0A= > + wtotal +=3D wcount;=0A= > if (info) {=0A= > info =3D 0;=0A= > (void)fprintf(stderr,=0A= > @@ -253,8 +252,8 @@ copy_file(const FTSENT *entp, int dne)=0A= > entp->fts_path, to.p_path,=0A= > cp_pct(wtotal, fs->st_size));= =0A= > }=0A= > - } while (rcount > 0);=0A= > - if (rcount < 0) {=0A= > + } while (wcount > 0);=0A= > + if (wcount < 0) {=0A= > warn("%s", entp->fts_path);=0A= > rval =3D 1;=0A= > }=0A= >=0A= >=0A= =0A= =0A= --=0A= Mateusz Guzik =0A=