patch-2.4.25 linux-2.4.25/fs/exec.c

Next file: linux-2.4.25/fs/ext2/ialloc.c
Previous file: linux-2.4.25/fs/dquot.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.24/fs/exec.c linux-2.4.25/fs/exec.c
@@ -427,6 +427,15 @@
 
 	old_mm = current->mm;
 
+	if (old_mm && atomic_read(&old_mm->mm_users) == 1) {
+		mm_release();
+		down_write(&old_mm->mmap_sem);
+		exit_mmap(old_mm);
+		up_write(&old_mm->mmap_sem);
+		return 0;
+	}
+
+
 	mm = mm_alloc();
 	if (mm) {
 		struct mm_struct *active_mm;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)