public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Q. d_alloc() in pipe(2)
@ 2009-12-29  5:55 hooanon05
  2009-12-29 15:02 ` Américo Wang
  2009-12-31  3:04 ` Bill Davidsen
  0 siblings, 2 replies; 4+ messages in thread
From: hooanon05 @ 2009-12-29  5:55 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q. d_alloc() in pipe(2)
  2009-12-29  5:55 Q. d_alloc() in pipe(2) hooanon05
@ 2009-12-29 15:02 ` Américo Wang
  2009-12-30  3:41   ` hooanon05
  2009-12-31  3:04 ` Bill Davidsen
  1 sibling, 1 reply; 4+ messages in thread
From: Américo Wang @ 2009-12-29 15:02 UTC (permalink / raw)
  To: hooanon05; +Cc: viro, linux-kernel

On Tue, Dec 29, 2009 at 02:55:20PM +0900, hooanon05@yahoo.co.jp 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.
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q. d_alloc() in pipe(2)
  2009-12-29 15:02 ` Américo Wang
@ 2009-12-30  3:41   ` hooanon05
  0 siblings, 0 replies; 4+ messages in thread
From: hooanon05 @ 2009-12-30  3:41 UTC (permalink / raw)
  To: Américo Wang; +Cc: viro, linux-kernel


Amrico Wang:
> >But d_alloc() refers name->len which is uninitialized.
> 
> Well, it is initialized to 0. :)

I didn't know that.
Thanx.


J. R. Okajima

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q. d_alloc() in pipe(2)
  2009-12-29  5:55 Q. d_alloc() in pipe(2) hooanon05
  2009-12-29 15:02 ` Américo Wang
@ 2009-12-31  3:04 ` Bill Davidsen
  1 sibling, 0 replies; 4+ messages in thread
From: Bill Davidsen @ 2009-12-31  3:04 UTC (permalink / raw)
  To: hooanon05; +Cc: viro, linux-kernel

hooanon05@yahoo.co.jp 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.
> Isn't it better to replace d_alloc() by d_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.

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-31  3:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29  5:55 Q. d_alloc() in pipe(2) hooanon05
2009-12-29 15:02 ` Américo Wang
2009-12-30  3:41   ` hooanon05
2009-12-31  3:04 ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox