Re: [PATCH] vma->shared list_head initializations

Andrew Morton (akpm@digeo.com)
Sat, 28 Sep 2002 21:49:22 -0700


Zach Brown wrote:
>
> more list_head debugging carnage.
>

yup

> --- linux-2.5.39/fs/exec.c.fmuta Sat Sep 28 19:50:20 2002
> +++ linux-2.5.39/fs/exec.c Sat Sep 28 19:51:08 2002
> @@ -400,6 +400,7 @@
> mpnt->vm_ops = NULL;
> mpnt->vm_pgoff = 0;
> mpnt->vm_file = NULL;
> + INIT_LIST_HEAD(&mpnt->shared);
> mpnt->vm_private_data = (void *) 0;
> insert_vm_struct(mm, mpnt);
> mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;

Fair enough, short-term. But what your patch is really saying
is "this code stinks".

We need to lose all those open-coded accesses to vm_area_cachep,
give that cache a constructor and possibly write some helper
functions. To lose all this fragile "did I remember to
initialise everything and has anyone added any more fields
since I wrote that code" gunk.

<looks hopefully at Christoph>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/