linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* wait4/waitpid/waitid oddness
@ 2006-04-06  3:38 Albert Cahalan
  2006-04-07  2:09 ` Joshua Hudson
  2006-04-07 18:23 ` Eric W. Biederman
  0 siblings, 2 replies; 10+ messages in thread
From: Albert Cahalan @ 2006-04-06  3:38 UTC (permalink / raw)
  To: linux-kernel

The kernel prohibits:

1. WNOHANG on waitpid/wait4
2. __WALL on waitid

Why? I need both at once.

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

* Re: wait4/waitpid/waitid oddness
  2006-04-06  3:38 wait4/waitpid/waitid oddness Albert Cahalan
@ 2006-04-07  2:09 ` Joshua Hudson
  2006-04-07  5:38   ` Kyle Moffett
  2006-04-07 18:23 ` Eric W. Biederman
  1 sibling, 1 reply; 10+ messages in thread
From: Joshua Hudson @ 2006-04-07  2:09 UTC (permalink / raw)
  To: Albert Cahalan; +Cc: linux-kernel

On 4/5/06, Albert Cahalan <acahalan@gmail.com> wrote:
> The kernel prohibits:
>
> 1. WNOHANG on waitpid/wait4
> 2. __WALL on waitid
>
> Why? I need both at once.

Why don't you try removing the checks and see if anything breaks. My instinct
says that waitid is less likely to break.

I'm the guy who removed the check in link() about source is a directory, found
out what broke, and am working on a patch to fix all the resulting breakage.
Your task is apt to be a lot simpler.

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

* Re: wait4/waitpid/waitid oddness
  2006-04-07  2:09 ` Joshua Hudson
@ 2006-04-07  5:38   ` Kyle Moffett
  2006-04-07  6:40     ` Joshua Hudson
  0 siblings, 1 reply; 10+ messages in thread
From: Kyle Moffett @ 2006-04-07  5:38 UTC (permalink / raw)
  To: Joshua Hudson; +Cc: Albert Cahalan, linux-kernel

On Apr 6, 2006, at 22:09:48, Joshua Hudson wrote:
> I'm the guy who removed the check in link() about source is a  
> directory, found out what broke, and am working on a patch to fix  
> all the resulting breakage.  Your task is apt to be a lot simpler.

I seem to recall the reason why hardlinking directories was  
prohibited had something more to do with some unfixable races and  
deadlocks in the kernel; not to mention creating self-referential  
directory trees that are never freed and chew up disk space.

Cheers,
Kyle Moffett


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

* Re: wait4/waitpid/waitid oddness
  2006-04-07  5:38   ` Kyle Moffett
@ 2006-04-07  6:40     ` Joshua Hudson
  2006-04-07  6:50       ` Neil Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Joshua Hudson @ 2006-04-07  6:40 UTC (permalink / raw)
  To: linux-kernel

On 4/6/06, Kyle Moffett <mrmacman_g4@mac.com> wrote:
> On Apr 6, 2006, at 22:09:48, Joshua Hudson wrote:
> > I'm the guy who removed the check in link() about source is a
> > directory, found out what broke, and am working on a patch to fix
> > all the resulting breakage.  Your task is apt to be a lot simpler.
>
> I seem to recall the reason why hardlinking directories was
> prohibited had something more to do with some unfixable races and
> deadlocks in the kernel; not to mention creating self-referential
> directory trees that are never freed and chew up disk space.

You recall correctly. I have fixed the self-referrential problem, and I
am testing a fix for the races and deadlocks. Desk proof is not good
enough for me.

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

* Re: wait4/waitpid/waitid oddness
  2006-04-07  6:40     ` Joshua Hudson
@ 2006-04-07  6:50       ` Neil Brown
  2006-04-07  7:09         ` Joshua Hudson
  0 siblings, 1 reply; 10+ messages in thread
From: Neil Brown @ 2006-04-07  6:50 UTC (permalink / raw)
  To: Joshua Hudson; +Cc: linux-kernel

On Thursday April 6, joshudson@gmail.com wrote:
> On 4/6/06, Kyle Moffett <mrmacman_g4@mac.com> wrote:
> > On Apr 6, 2006, at 22:09:48, Joshua Hudson wrote:
> > > I'm the guy who removed the check in link() about source is a
> > > directory, found out what broke, and am working on a patch to fix
> > > all the resulting breakage.  Your task is apt to be a lot simpler.
> >
> > I seem to recall the reason why hardlinking directories was
> > prohibited had something more to do with some unfixable races and
> > deadlocks in the kernel; not to mention creating self-referential
> > directory trees that are never freed and chew up disk space.
> 
> You recall correctly. I have fixed the self-referrential problem, and I
> am testing a fix for the races and deadlocks. Desk proof is not good
> enough for me.

I wonder what you are doing about the conceptual problem of 
  What does ".." mean now?

NeilBrown

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

* Re: wait4/waitpid/waitid oddness
  2006-04-07  6:50       ` Neil Brown
@ 2006-04-07  7:09         ` Joshua Hudson
  0 siblings, 0 replies; 10+ messages in thread
From: Joshua Hudson @ 2006-04-07  7:09 UTC (permalink / raw)
  To: linux-kernel

> I wonder what you are doing about the conceptual problem of
>   What does ".." mean now?
>
> NeilBrown
dnode->d_parent.

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

* Re: wait4/waitpid/waitid oddness
  2006-04-06  3:38 wait4/waitpid/waitid oddness Albert Cahalan
  2006-04-07  2:09 ` Joshua Hudson
@ 2006-04-07 18:23 ` Eric W. Biederman
  2006-04-07 18:58   ` Joshua Hudson
  1 sibling, 1 reply; 10+ messages in thread
From: Eric W. Biederman @ 2006-04-07 18:23 UTC (permalink / raw)
  To: Albert Cahalan; +Cc: linux-kernel

"Albert Cahalan" <acahalan@gmail.com> writes:

> The kernel prohibits:
>
> 1. WNOHANG on waitpid/wait4

Not 2.6.17-rc1, and not for a lot of earlier kernels.
At least not on ingress, and just skimming the code
I can't see any deeper checks that would prevent this.

> 2. __WALL on waitid
>
> Why? I need both at once.

Which kernel is failing, and how?

Eric

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

* Re: wait4/waitpid/waitid oddness
  2006-04-07 18:23 ` Eric W. Biederman
@ 2006-04-07 18:58   ` Joshua Hudson
  2006-04-07 19:19     ` Eric W. Biederman
  0 siblings, 1 reply; 10+ messages in thread
From: Joshua Hudson @ 2006-04-07 18:58 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel

On 4/7/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
> "Albert Cahalan" <acahalan@gmail.com> writes:
>
> > The kernel prohibits:
> >
> > 1. WNOHANG on waitpid/wait4
>
> Not 2.6.17-rc1, and not for a lot of earlier kernels.
> At least not on ingress, and just skimming the code
> I can't see any deeper checks that would prevent this.
>
> > 2. __WALL on waitid
> >
> > Why? I need both at once.
>
> Which kernel is failing, and how?

LKNL 2.6.16.1 has this check. Haven't checked any others.

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

* Re: wait4/waitpid/waitid oddness
  2006-04-07 18:58   ` Joshua Hudson
@ 2006-04-07 19:19     ` Eric W. Biederman
  2006-04-07 19:24       ` Joshua Hudson
  0 siblings, 1 reply; 10+ messages in thread
From: Eric W. Biederman @ 2006-04-07 19:19 UTC (permalink / raw)
  To: Joshua Hudson; +Cc: linux-kernel

"Joshua Hudson" <joshudson@gmail.com> writes:

> On 4/7/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
>> "Albert Cahalan" <acahalan@gmail.com> writes:
>>
>> > The kernel prohibits:
>> >
>> > 1. WNOHANG on waitpid/wait4
>>
>> Not 2.6.17-rc1, and not for a lot of earlier kernels.
>> At least not on ingress, and just skimming the code
>> I can't see any deeper checks that would prevent this.
>>
>> > 2. __WALL on waitid
>> >
>> > Why? I need both at once.
>>
>> Which kernel is failing, and how?
>
> LKNL 2.6.16.1 has this check. Haven't checked any others.

So what I see current in wait4 is:
> asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
> 			  int options, struct rusage __user *ru)
> {
> 	long ret;
> 
> 	if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
> 			__WNOTHREAD|__WCLONE|__WALL))
> 		return -EINVAL;

This denies access if you use other flags but it should allow
__WALL and WNOHANG together.  I didn't see anything in do_wait,
that would prohibit this.

> 	ret = do_wait(pid, options | WEXITED, NULL, stat_addr, ru);
> 
> 	/* avoid REGPARM breakage on x86: */
> 	prevent_tail_call(ret);
> 	return ret;
> }

So where are you seeing the check in 2.6.16.1?

Eric



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

* Re: wait4/waitpid/waitid oddness
  2006-04-07 19:19     ` Eric W. Biederman
@ 2006-04-07 19:24       ` Joshua Hudson
  0 siblings, 0 replies; 10+ messages in thread
From: Joshua Hudson @ 2006-04-07 19:24 UTC (permalink / raw)
  To: linux-kernel

> So what I see current in wait4 is:
> > asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
> >                         int options, struct rusage __user *ru)
> > {
> >       long ret;
> >
> >       if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
> >                       __WNOTHREAD|__WCLONE|__WALL))
> >               return -EINVAL;
>
> So where are you seeing the check in 2.6.16.1?
>
> Eric
Stupid me. I read that w/o the tilde.

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

end of thread, other threads:[~2006-04-07 19:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06  3:38 wait4/waitpid/waitid oddness Albert Cahalan
2006-04-07  2:09 ` Joshua Hudson
2006-04-07  5:38   ` Kyle Moffett
2006-04-07  6:40     ` Joshua Hudson
2006-04-07  6:50       ` Neil Brown
2006-04-07  7:09         ` Joshua Hudson
2006-04-07 18:23 ` Eric W. Biederman
2006-04-07 18:58   ` Joshua Hudson
2006-04-07 19:19     ` Eric W. Biederman
2006-04-07 19:24       ` Joshua Hudson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).