patch-2.3.99-pre7 linux/kernel/exec_domain.c
Next file: linux/kernel/exit.c
Previous file: linux/ipc/util.c
Back to the patch index
Back to the overall index
-  Lines: 19
-  Date:
Tue May  9 16:18:27 2000
-  Orig file: 
v2.3.99-pre6/linux/kernel/exec_domain.c
-  Orig date: 
Wed Apr 26 16:34:09 2000
diff -u --recursive --new-file v2.3.99-pre6/linux/kernel/exec_domain.c linux/kernel/exec_domain.c
@@ -110,9 +110,16 @@
 	if (it) {
 		if (atomic_read(¤t->fs->count) != 1) {
 			struct fs_struct *new = copy_fs_struct(current->fs);
-			if (!new)
+			struct fs_struct *old;
+			if (!new) {
+				put_exec_domain(it);
 				return;
-			put_fs_struct(xchg(¤t->fs,new));
+			}
+			task_lock(current);
+			old = current->fs;
+			current->fs = new;
+			task_unlock(current);
+			put_fs_struct(old);
 		}
 		/*
 		 * At that point we are guaranteed to be the sole owner of
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)