shithub: unionfs

Download patch

ref: c29f9884bb2aba8ac6a2b9286d582ba86dd61ae1
parent: c1eed337afadb15156a5364767c3e3755586e537
author: kvik <kvik@a-b.xyz>
date: Fri Aug 6 12:37:29 EDT 2021

Remove flush note retry loop

The retry loop was intended to make sure that we flush the
process, but the approach is very brittle. For one, user none
isn't allowed to send notes at all which would cause this
loop to get stuck forever.

For now, flushing isn't going to work at all if you run unionfs
under 'none'.

--- a/unionfs.c
+++ b/unionfs.c
@@ -341,9 +341,10 @@
 	case Tread:
 	case Twrite:
 		f->flushed = 1;
-		while(postnote(PNPROC, f->pid, "flush") != 0)
-			sleep(100);
-		respond(r->oldreq, "interrupted");
+		if(postnote(PNPROC, f->pid, "flush") == 0)
+			respond(r->oldreq, "interrupted");
+		else
+			fprint(2, "fsflush: %r");
 	}
 	respond(r, nil);
 }