Date: Sat, 4 Oct 2014 15:49:56 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Garrett Cooper <yaneurabeya@gmail.com> Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin <jhb@freebsd.org>, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Glen Barber <gjb@freebsd.org>, Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r272372 - stable/10/bin/rm Message-ID: <20141004145802.M1399@besplex.bde.org> In-Reply-To: <B01C20CC-3034-43AC-B776-A396E15DD6D1@gmail.com> References: <201410011618.s91GIfR5071251@svn.freebsd.org> <20141002141656.Y1807@besplex.bde.org> <20141002061628.GO1275@hub.FreeBSD.org> <201410021713.57943.jhb@freebsd.org> <20141003084842.T998@besplex.bde.org> <B01C20CC-3034-43AC-B776-A396E15DD6D1@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 3 Oct 2014, Garrett Cooper wrote: > On Oct 2, 2014, at 16:34, Bruce Evans <brde@optusnet.com.au> wrote: > >> There is still the larger problem with fts_read(). Applications like rm >> are specified to do a complete tree walk, with special handling for file= s >> that do not exist. If fts_read() is going to abort in the middle of a >> tree walk, then it is unusable for implementing applications like rm. > > +1. In this case I was doing a du -sh /* while I was running rm -Rf /rel = (an old make release directory tree). This stopped the du -sh: > > $ sudo du -sh /* > 8.0K /COPYRIGHT > 996K /bin > ... > du: /rel/usr/ports/net/fsplib: No such file or directory > du: fts_read: No such file or directory It is fine garbage collection to delete itself, but that should be more like "du: du: No such file or directory" :-). > =09The problem with changing fts_read to ignore ENOENT or other errors wi= ll break compatibility with Linux [and other OSes potentially], and is not = the correct solution for this issue. I do however think that the errnos to = ignore with -f should be... > > - EACCES > - ENOENT > - EPERM No, the only error that can be safely ignored in most cases is ENOENT. EACCES and EPERM mean that rm has failed to remove the requested files. More errors could be ignored under a different option. > =09=85 as filtering out these errors would handle the case that -f should= handle according to the manpage: > > -f Attempt to remove the files without prompting for confirmatio= n, > regardless of the file's permissions. If the file does not > exist, do not display a diagnostic message or modify the exit > status to reflect an error. The -f option overrides any prev= ious > -i options. I didn't realize theat the man page was that broken. It doesn't even menti= on the main effect of -f -- to ignore errors for nonexistent files. This is discussed in the COMPATIBILITY section, with quite bad wording: % COMPATIBILITY % The rm utility differs from historical implementations in that the -= f % option only masks attempts to remove non-existent files instead of m= ask- % ing a large variety of errors. The -v option is non-standard and it= s use % in scripts is not recommended. "masks attempts to remove" is strange wording. rm doesn't attempt to remove nonexistent files; it attempts to remove existent files ... The code doesn't do anything like that. It is close to POSIX, and just tries to remove existent files and then ignores the ENOENT error for nonexistent files iff -f. These bugs haven't changed since FreeBSD-1 (Net/2?). They are only in the man page. The change to POSIX conformance is documented in the FreeBSD-1 version: %%% /* * rm -- *=09This rm is different from historic rm's, but is expected to match *=09POSIX 1003.2 behavior. The most visible difference is that -f *=09has two specific effects now, ignore non-existent files and force * =09file removal. */ %%% This hasn't changed, and neither has the man page which apparently documents a version before this. I think it is misleading to say "force file removal". I still tend to think of the f in rm -f being "force". That seems to have been last correct in 1988 (?) before Net/2. All f does is to force is turn off some checking and interactivity. It doesn't do things like clobbering immutable flags so that unlink() can work. Bruce From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 4 05:59:10 2014 Return-Path: <owner-svn-src-stable-10@FreeBSD.ORG> Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B55BE6A9; Sat, 4 Oct 2014 05:59:10 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 70A673CD; Sat, 4 Oct 2014 05:59:09 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id CCB87D43D00; Sat, 4 Oct 2014 15:59:00 +1000 (EST) Date: Sat, 4 Oct 2014 15:58:59 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> X-X-Sender: bde@besplex.bde.org To: Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r272372 - stable/10/bin/rm In-Reply-To: <20141004145802.M1399@besplex.bde.org> Message-ID: <20141004155126.W1586@besplex.bde.org> References: <201410011618.s91GIfR5071251@svn.freebsd.org> <20141002141656.Y1807@besplex.bde.org> <20141002061628.GO1275@hub.FreeBSD.org> <201410021713.57943.jhb@freebsd.org> <20141003084842.T998@besplex.bde.org> <B01C20CC-3034-43AC-B776-A396E15DD6D1@gmail.com> <20141004145802.M1399@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=MM4l8k_P8ruoUpHBXfQA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: src-committers@freebsd.org, svn-src-stable-10@freebsd.org, John Baldwin <jhb@freebsd.org>, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Glen Barber <gjb@freebsd.org>, Garrett Cooper <yaneurabeya@gmail.com> X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree <svn-src-stable-10.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-10/> List-Post: <mailto:svn-src-stable-10@freebsd.org> List-Help: <mailto:svn-src-stable-10-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 04 Oct 2014 05:59:10 -0000 On Sat, 4 Oct 2014, Bruce Evans wrote: > On Fri, 3 Oct 2014, Garrett Cooper wrote: >> =09=85 as filtering out these errors would handle the case that -f shoul= d=20 >> handle according to the manpage: >>=20 >> -f Attempt to remove the files without prompting for confirmati= on, >> regardless of the file's permissions. If the file does not >> exist, do not display a diagnostic message or modify the exi= t >> status to reflect an error. The -f option overrides any=20 >> previous >> -i options. > > I didn't realize theat the man page was that broken. It doesn't even men= tion > the main effect of -f -- to ignore errors for nonexistent files. This is > discussed in the COMPATIBILITY section, with quite bad wording: Oops, I missed the second sentence in the above. > % COMPATIBILITY > % The rm utility differs from historical implementations in that the= -f > % option only masks attempts to remove non-existent files instead of= =20 > mask- > % ing a large variety of errors. The -v option is non-standard and = its=20 > use > % in scripts is not recommended. > > "masks attempts to remove" is strange wording. rm doesn't attempt to > remove nonexistent files; it attempts to remove existent files ... > > The code doesn't do anything like that. It is close to POSIX, and just > tries to remove existent files and then ignores the ENOENT error for > nonexistent files iff -f. I misread this too. There are only minor wording problems. Bruce From owner-svn-src-stable-10@FreeBSD.ORG Sat Oct 4 14:38:39 2014 Return-Path: <owner-svn-src-stable-10@FreeBSD.ORG> Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BF8CBE; Sat, 4 Oct 2014 14:38:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4860B0F; Sat, 4 Oct 2014 14:38:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s94EcdFm085102; Sat, 4 Oct 2014 14:38:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s94Ecde0085101; Sat, 4 Oct 2014 14:38:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201410041438.s94Ecde0085101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala <trasz@FreeBSD.org> Date: Sat, 4 Oct 2014 14:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272525 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree <svn-src-stable-10.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-10/> List-Post: <mailto:svn-src-stable-10@freebsd.org> List-Help: <mailto:svn-src-stable-10-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10>, <mailto:svn-src-stable-10-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 04 Oct 2014 14:38:39 -0000 Author: trasz Date: Sat Oct 4 14:38:39 2014 New Revision: 272525 URL: https://svnweb.freebsd.org/changeset/base/272525 Log: MFC 271759: Add missing links to taskqueue(9). Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Oct 4 14:30:16 2014 (r272524) +++ stable/10/share/man/man9/Makefile Sat Oct 4 14:38:39 2014 (r272525) @@ -1345,6 +1345,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ + taskqueue.9 taskqueue_cancel_timeout.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ @@ -1352,13 +1353,18 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ taskqueue.9 taskqueue_drain_all.9 \ + taskqueue.9 taskqueue_drain_timeout.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ + taskqueue.9 taskqueue_enqueue_timeout.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_set_callback.9 \ + taskqueue.9 taskqueue_start_threads.9 \ + taskqueue.9 taskqueue_start_threads_pinned.9 \ taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141004145802.M1399>