Q. d_alloc() in pipe(2)
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. Isn't it better to replace d_alloc() by d_alloc_name(root, "")?
J. R. Okajima
Quoted 6 lines · On Tue, Dec 29, 2009 at 02:55:20PM +0900, [email protected] wrote:
In pipe(2),
create_write_pipe()creates a dentry bystruct qstr name = { .name = "" }; d_alloc(root, &name);But
d_alloc()refersname->lenwhich is uninitialized.
Well, it is initialized to 0. :)
Quoted 2 lines
Isn't it better to replace
d_alloc()byd_alloc_name(root, "")?
Maybe not, they totally equal in this case, IMO.
Signature · 1 line
Live like a child, think like the god.
Amrico Wang:
Quoted 3 lines
Quoted 1 line
But
d_alloc()refersname->lenwhich is uninitialized.Well, it is initialized to 0. :)
I didn't know that.
Thanx.
J. R. Okajima
Quoted 7 lines · [email protected] wrote:
In pipe(2),
create_write_pipe()creates a dentry bystruct qstr name = { .name = "" }; d_alloc(root, &name);But
d_alloc()refersname->lenwhich is uninitialized. Isn't it better to replaced_alloc()byd_alloc_name(root, "")?
If readability counts, I would say so. Functionally I don't know, I can't see any problems other than it's unobvious.
Signature · 3 lines
Bill Davidsen <[email protected]> "We have more to fear from the bungling of the incompetent than from the machinations of the wicked." - from Slashdot