Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Oct 2014 16:19:00 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r272373 - stable/9/bin/rm
Message-ID:  <201410011619.s91GJ0W4071337@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Wed Oct  1 16:18:59 2014
New Revision: 272373
URL: https://svnweb.freebsd.org/changeset/base/272373

Log:
  MFC r268376 (imp):
  
    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.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/9/bin/rm/rm.c
Directory Properties:
  stable/9/bin/rm/   (props changed)

Modified: stable/9/bin/rm/rm.c
==============================================================================
--- stable/9/bin/rm/rm.c	Wed Oct  1 16:18:40 2014	(r272372)
+++ stable/9/bin/rm/rm.c	Wed Oct  1 16:18:59 2014	(r272373)
@@ -329,7 +329,7 @@ err:
 		warn("%s", p->fts_path);
 		eval = 1;
 	}
-	if (errno)
+	if (!fflag && errno)
 		err(1, "fts_read");
 	fts_close(fts);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410011619.s91GJ0W4071337>