Index: cachefilesd-0.10.5/cachefilesd.c
===================================================================
--- cachefilesd-0.10.5.orig/cachefilesd.c	2011-12-06 14:38:00.000000000 +0100
+++ cachefilesd-0.10.5/cachefilesd.c	2014-05-29 10:29:19.197764686 +0200
@@ -86,6 +86,7 @@
 /* current scan point */
 static struct object *scan = &root;
 static int jumpstart_scan = 0;
+static int cull_delayed = 0;
 
 /* ranked order of cullable objects
  * - we have two tables: one we're building and one that's full of ready to be
@@ -244,6 +245,7 @@
 static void sigalrm(int sig)
 {
 	jumpstart_scan = 1;
+	cull_delayed = 0;
 }
 
 /*****************************************************************************/
@@ -605,11 +607,11 @@
 
 		/* sleep without racing on reap and cull with the signal
 		 * handlers */
-		if (!scan && !reap && !cull) {
+		if (!scan && !reap && !cull && !cull_delayed) {
 			if (sigprocmask(SIG_BLOCK, &sigs, &osigs) < 0)
 				oserror("Unable to block signals");
 
-			if (!reap && !cull) {
+			if (!reap && !cull && !jumpstart_scan) {
 				if (ppoll(pollfds, 1, NULL, &osigs) < 0 &&
 				    errno != EINTR)
 					oserror("Unable to suspend process");
@@ -636,7 +638,7 @@
 			if (cull) {
 				if (oldest_ready >= 0)
 					cull_objects();
-				else if (oldest_build < 0)
+				else if (oldest_build < 0 && !cull_delayed)
 					jumpstart_scan = 1;
 			}
 
@@ -1351,6 +1353,7 @@
 
 	/* if nothing there, scan again in a short while */
 	if (oldest_build < 0) {
+		cull_delayed = 1;
 		signal(SIGALRM, sigalrm);
 		alarm(30);
 		return;
