From owner-svn-src-all@freebsd.org Fri Sep 11 21:43:35 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 2D41A3E7024; Fri, 11 Sep 2020 21:43:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Bp8QG6LgDz3f6b; Fri, 11 Sep 2020 21:43:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08BLhRxw075567 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 12 Sep 2020 00:43:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08BLhRxw075567 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08BLhR5Z075566; Sat, 12 Sep 2020 00:43:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 12 Sep 2020 00:43:27 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365643 - head/bin/cp Message-ID: <20200911214327.GY94807@kib.kiev.ua> References: <202009112049.08BKnavL032212@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009112049.08BKnavL032212@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Bp8QG6LgDz3f6b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] 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: Fri, 11 Sep 2020 21:43:35 -0000 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.