Subject: Re: curproc removal (NFS, ...)
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 05/25/2004 03:17:39
On Tue, May 25, 2004 at 03:39:17PM +0900, YAMAMOTO Takashi wrote:
>
> i don't understand what's the point of this change.
> i think that NULL is fine.
> 
> i understand why you want to eliminate curproc.
> but i don't understand why you want to eliminate (struct proc *)NULL
> and (ab)use uio_procp.

Perhaps the invariant for some of the called functions is "there is a
process context" -- that we aren't in the bottom half of the kernel.
I can think of quite a bit of code like that, in fact -- and in almost
every case in which I've encountered it, passing in curproc has papered
over a serious bug, until the function happened to be called in interrupt
context, that is.

Why else would passing in an almost arbitrary process solve any problem?
I can't see any way out of this but careful code reading and analysis;
so I think you're probably onto something here: these functions should
either work fine if handed a NULL process pointer, or explicitly panic.
The question is which is which.

Thor