Re: [patch-2.4.0-test6-pre8] fork.c FIXME removed (UPDATE)

From: Andrey Savochkin (saw@saw.sw.com.sg)
Date: Tue Aug 08 2000 - 06:19:06 EST


Bill,

locked_vm shouldn't be copied. It's a bug in the original code, too.
Areas are unlocked in the child process, see clearing VM_LOCKED below.

Best regards
                Andrey

On Tue, Aug 08, 2000 at 03:49:08AM -0500, Bill Wendling wrote:
> diff -Naur linux-2.4.0-test6-pre8/kernel/fork.c linux-2.4.0-test6-pre8-new/kernel/fork.c
> --- linux-2.4.0-test6-pre8/kernel/fork.c Tue Aug 8 03:29:16 2000
> +++ linux-2.4.0-test6-pre8-new/kernel/fork.c Tue Aug 8 03:47:00 2000
> @@ -126,10 +126,24 @@
> static inline int dup_mmap(struct mm_struct * mm)
> {
> struct vm_area_struct * mpnt, *tmp, **pprev;
> + struct mm_struct *current_mm = current->mm;
> int retval;
>
> - /* Kill me slowly. UGLY! FIXME! */
> - memcpy(&mm->start_code, &current->mm->start_code, 15*sizeof(unsigned long));
> + mm->start_code = current_mm->start_code;
> + mm->end_code = current_mm->end_code;
> + mm->start_data = current_mm->start_data;
> + mm->end_data = current_mm->end_data;
> + mm->start_brk = current_mm->start_brk;
> + mm->brk = current_mm->brk;
> + mm->start_stack = current_mm->start_stack;
> + mm->arg_start = current_mm->arg_start;
> + mm->arg_end = current_mm->arg_end;
> + mm->env_start = current_mm->env_start;
> + mm->env_end = current_mm->env_end;
> + mm->rss = current_mm->rss;
> + mm->total_vm = current_mm->total_vm;
> + mm->locked_vm = current_mm->locked_vm;
> + mm->def_flags = current_mm->def_flags;
>
> flush_cache_mm(current->mm);
> pprev = &mm->mmap;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:15 EST