summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-10-01 16:18:40 +0000
committergjb <gjb@FreeBSD.org>2014-10-01 16:18:40 +0000
commit5f63f50572936527c79a35d2d2b866a59ce277ec (patch)
tree8bc77214b3ecfcfc244584949ae7ba9e918f28ee /bin
parent6dff660c17910a0a9daadcedba96a1f38ed00dfd (diff)
downloadFreeBSD-src-5f63f50572936527c79a35d2d2b866a59ce277ec.zip
FreeBSD-src-5f63f50572936527c79a35d2d2b866a59ce277ec.tar.gz
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. Approved by: re (kib) Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'bin')
-rw-r--r--bin/rm/rm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 976b4ee..46807b9 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -335,7 +335,7 @@ err:
warn("%s", p->fts_path);
eval = 1;
}
- if (errno)
+ if (!fflag && errno)
err(1, "fts_read");
fts_close(fts);
}
OpenPOWER on IntegriCloud