Re: Q. d_alloc() in pipe(2)

From: AmÃrico Wang
Date: Tue Dec 29 2009 - 10:01:16 EST


On Tue, Dec 29, 2009 at 02:55:20PM +0900, hooanon05@xxxxxxxxxxx wrote:
>
>In pipe(2), create_write_pipe() creates a dentry by
> struct qstr name = { .name = "" };
> d_alloc(root, &name);
>
>But d_alloc() refers name->len which is uninitialized.

Well, it is initialized to 0. :)

>Isn't it better to replace d_alloc() by d_alloc_name(root, "")?
>

Maybe not, they totally equal in this case, IMO.

--
Live like a child, think like the god.

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