From owner-svn-src-all@FreeBSD.ORG Mon Jul 7 23:21:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 405391BB; Mon, 7 Jul 2014 23:21:21 +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 2DD962C63; Mon, 7 Jul 2014 23:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67NLLCr070714; Mon, 7 Jul 2014 23:21:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67NLL7p070713; Mon, 7 Jul 2014 23:21:21 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407072321.s67NLL7p070713@svn.freebsd.org> From: Warner Losh Date: Mon, 7 Jul 2014 23:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268376 - head/bin/rm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Mon, 07 Jul 2014 23:21:21 -0000 Author: imp Date: Mon Jul 7 23:21:20 2014 New Revision: 268376 URL: http://svnweb.freebsd.org/changeset/base/268376 Log: rm -rf can fail sometimes with an error from fts_read. Make it honor fflag to ignore fts_read errors, but stop deleting from that directory because no further progress can be made. When building a kernel with a high -j value on a high core count machine, during the cleanobj phase we can wind up doing multiple rm -rf at the same time for modules that have subdirectories. This exposed this race (sometimes) as fts_read can return an error if the directory is removed by another rm -rf. Since the intent of the -f flag was to ignore errors, even if this was a bug in fts_read, we should ignore the error like we've been instructed to do. Modified: head/bin/rm/rm.c Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Mon Jul 7 23:21:15 2014 (r268375) +++ head/bin/rm/rm.c Mon Jul 7 23:21:20 2014 (r268376) @@ -335,7 +335,7 @@ err: warn("%s", p->fts_path); eval = 1; } - if (errno) + if (!fflag && errno) err(1, "fts_read"); fts_close(fts); }