shithub: riscv

Download patch

ref: e80c7eb50b65ff7bc864fe551c24ac26c15f3e8d
parent: ee2174eb6d33da8eea7d1f68101b70deb12a2a4c
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);
 }