From owner-svn-src-all@freebsd.org Sat Sep 19 18:00:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06BC63EA795; Sat, 19 Sep 2020 18:00:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Btz4q1n3Bz4HX3; Sat, 19 Sep 2020 18:00:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f49.google.com with SMTP id 95so1252568ota.13; Sat, 19 Sep 2020 11:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dLQf7cWcyFHzMBzPatf3ptJmSioPK44byIz2bqsc4Iw=; b=hCebZp5D+Q3u5oQTLgTF5goM6p4MqSQW0zl5s3BcNMTFhaFPJlZonjEEUs3ZrkNbsE oV7F9EybM/5smHbZzIS6MoYOpZsCLADY2JU9csHOtvQ4kjP7i8pP298Hj5PrCLfXdlyk E/NMmJdlamZGe1hFP/zlpO6uuQlXWItN03PjU+gGV6xnryJq7FSg1QOuTD1zJldrfwFw qNTRJjXeOTZAz7zW1GOEZWK7bkhDi8paGq1XsOHcsQ2E6k6/NW7fS9PvI6AMJMOvniKx WCJgV4CucaSs7Z7lw72e/NfD22jx1SKLg84aHrnUm7ut5sh5/VWdt9d6huc8bEryYzRR WUWA== X-Gm-Message-State: AOAM531tFM0uHBzElqOo8SU4eBYfy8LjVIyvQDlyopJseMgduLeZModS dfLgvOVt+RxgTnEAiv3p9qzK++Hb26LtgzOGSr8= X-Google-Smtp-Source: ABdhPJzA7g1R0xmKqHsiWxIfnSy81v6PPSsRrFfYBBeNuR7l1fPyMXFlaksuDWfPyt/jY+RDcjlba5tfORwUZEvlGAw= X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr27363571otr.18.1600538410012; Sat, 19 Sep 2020 11:00:10 -0700 (PDT) MIME-Version: 1.0 References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> In-Reply-To: From: Alan Somers Date: Sat, 19 Sep 2020 11:59:58 -0600 Message-ID: Subject: Re: svn commit: r365643 - head/bin/cp To: Rick Macklem Cc: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4Btz4q1n3Bz4HX3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.49 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.26 / 15.00]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.49:from]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.05)[-1.047]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.25)[-0.249]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.49:from]; NEURAL_HAM_MEDIUM(-0.96)[-0.965]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 18:00:12 -0000 On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem wrote: > Konstantin Belousov wrote: > >On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > >> Author: asomers > >> Date: Fri Sep 11 20:49:36 2020 > >> New Revision: 365643 > >> URL: https://svnweb.freebsd.org/changeset/base/365643 > >> > >> Log: > >> cp: fall back to read/write if copy_file_range fails > >> > >> Even though copy_file_range has a file-system agnostic version, it > still > >> fails on devfs (perhaps because the file descriptor is non-seekable?) > In > >> that case, fallback to old-fashioned read/write. Fixes > >> "cp /dev/null /tmp/null" > > > >Devices are seekable. > > > >The reason for EINVAL is that vn_copy_file_range() checks that both in > and out > >vnodes are VREG. For devfs, they are VCHR. > > I coded the syscall to the Linux man page, which states that EINVAL is > returned > if either fd does not refer to a regular file. > Having said that, I do not recall testing the VCHR case under Linux. (ie. > It might > actually work and the man page turns out to be incorrect?) > > I will test this case under Linux when I get home next week, rick > Since there's no standard, I think it's fine for us to support devfs if possible.