From 5c39f31087ffd02cd22a3370e2a4a8f2e854ebfb Mon Sep 17 00:00:00 2001 From: Margo Seltzer Date: Wed, 2 Sep 1992 20:21:17 -0800 Subject: [PATCH] Don't clean if its not possible for us to generate any new segments. SCCS-vsn: libexec/lfs_cleanerd/cleanerd.c 5.5 --- usr/src/libexec/lfs_cleanerd/cleanerd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr/src/libexec/lfs_cleanerd/cleanerd.c b/usr/src/libexec/lfs_cleanerd/cleanerd.c index c914328b45..388a7997cf 100644 --- a/usr/src/libexec/lfs_cleanerd/cleanerd.c +++ b/usr/src/libexec/lfs_cleanerd/cleanerd.c @@ -12,7 +12,7 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)cleanerd.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)cleanerd.c 5.5 (Berkeley) %G%"; #endif /* not lint */ #include @@ -167,8 +167,9 @@ clean_loop(fsp) * space is less than BUSY_LIM % of possible clean space. */ now = time((time_t *)NULL); - if (fsp->fi_cip->clean <= MIN_SEGS(&fsp->fi_lfs) || - fsp->fi_cip->clean < max_free_segs * BUSY_LIM) { + if (fsp->fi_cip->clean < max_free_segs && + (fsp->fi_cip->clean <= MIN_SEGS(&fsp->fi_lfs) || + fsp->fi_cip->clean < max_free_segs * BUSY_LIM)) { printf("Cleaner Running at %s (need space)\n", ctime(&now)); clean_fs(fsp, cost_benefit); -- 2.20.1