From owner-svn-src-all@freebsd.org Fri Sep 25 17:36:16 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 2C66E3FDE42; Fri, 25 Sep 2020 17:36:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ByfGQ60DYz4HMX; Fri, 25 Sep 2020 17:36:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 08PHa5ka051531; Fri, 25 Sep 2020 10:36:05 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 08PHa5nS051530; Fri, 25 Sep 2020 10:36:05 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202009251736.08PHa5nS051530@gndrsh.dnsmgr.net> Subject: Re: svn commit: r365643 - head/bin/cp In-Reply-To: <20200923224933.GL2570@kib.kiev.ua> To: Konstantin Belousov Date: Fri, 25 Sep 2020 10:36:05 -0700 (PDT) CC: Warner Losh , "Rodney W. Grimes" , Kyle Evans , Alan Somers , Mateusz Guzik , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4ByfGQ60DYz4HMX X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.04 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_NA(0.00)[no SPF record]; NEURAL_SPAM_SHORT(0.08)[0.079]; NEURAL_HAM_LONG(-0.26)[-0.258]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.32)[0.322]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; FREEMAIL_CC(0.00)[bsdimp.com,freebsd.org,gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all]; RCVD_COUNT_TWO(0.00)[2] 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, 25 Sep 2020 17:36:16 -0000 > On Wed, Sep 23, 2020 at 11:23:51AM -0600, Warner Losh wrote: > > On Wed, Sep 23, 2020, 10:56 AM Rodney W. Grimes > > wrote: > > > > > > cp is already fixed, people are still feeling the fallout of being > > > > within those revisions and needing to bootstrap their own cp. We can > > > > reduce the number of components these invocations rely on trivially to > > > > shell built-in mechanics, why not do so? > > > > > > I would even go further, I would like to see the dependency on > > > /dev/null removed from the build, and the boot process. > > > > > > > A worthy goal, but one I'm afraid is out of our reach. A quick grep shows > > just over 200 instances of /dev/null in the Makefile and mk file (800 if > > you don't filter Makefile.in and Makefile.am). Maybe a third of those are > > due to tests and other false positives. It would be quite the effort to > > eliminate them all. And /dev/tty and /dev/zero likely will be troublesome > > too, as they are used by running programs. > > > > and how would you throw away output you know is bad / bogus without > > /dev/null? > > > > >From the build because it means I would no longer have to > > > mount /dev in my chroots, and from the boot because I > > > hate to say it, but we often scribble in /dev before > > > devfs is mounted and if you look at root file systems > > > mounted on other systems you well often find a /dev/null > > > FILE that got created during the boot process from a >/dev/null > > > before devfs was mounted. > > > > > > > But for this issue, we're not mounting devfs early enough. We should fix > > that. Removing /dev/null from the boot process likely is never going to > > happen because we use it all over the place to discard output... There's > > ~200 instances of it in the boot rc scripts, so getting rid of it there > > would also be quite the effort, with the same question. > I would like to see some evidence for this actually occuring. > > We mount devfs instance before root (yes), to get the device nodes > available, so we can specify device name for root mount from loader. > After mounting root we do a rearrangement to move devfs to /dev, which > is somewhat tricky due to e.g. namecache. > > I do not see how could anything in userspace even touch the underlying > directory on rootfs of the /dev devfs mount. > > OTOH, it is a usual problem with /tmp getting dirty, and the garbage > hidden with tmpfs/md UFS mount over /tmp. I consistantly find a /dev/null FILE on most systems when I take a volume out of one machine and mount it as a non-boot volume. I believe you can also see these in the underlying file system on UFS with dump, or with zfs send. -- Rod Grimes rgrimes@freebsd.org