git: 9front

Download patch

ref: d10dae5eef601dc74e55653dcfca3c6cb673847a
parent: 06bd90dbe5d93aa556920c4ab868edc2e74f6edb
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jan 5 02:07:53 EST 2024

cifs: fix rfork() race with shard pid variable

--- a/sys/src/cmd/cifs/main.c
+++ b/sys/src/cmd/cifs/main.c
@@ -1325,10 +1325,11 @@
 	if(Nshares == 0)
 		fprint(2, "no available shares\n");
 
-	if((Keeppid = rfork(RFPROC|RFMEM|RFNOTEG|RFFDG|RFNAMEG)) == 0){
+	if((i = rfork(RFPROC|RFMEM|RFNOTEG|RFFDG|RFNAMEG)) == 0){
 		keepalive();
 		exits(nil);
 	}
+	Keeppid = i;
 	postmountsrv(&fs, svs, mtpt, MREPL|MCREATE);
 	exits(nil);
 }
--