Subject: Re: S_IFREG support to mknod(2)
To: None <tech-kern@netbsd.org>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-kern
Date: 02/16/2007 19:23:29
On Fri Feb 16 2007 at 16:51:45 +0000, David Laight wrote:
> Not really, but you've made me look at sys_mknod()!
> 
> AFAICT the recent changes for vn_start_write() have broken the error paths.

I can't see it.  if vn_start_write() fails, it will reset the situation
and restart.  And you can't end up both in the vn_start_write() failure
branch and the error branch without going through start and collecting
$vnode.

Of course it might be argued that if you're going to fail with EEXIST
anyway, you don't need to vn_start_write(), but that's not really a bug.

Am I not seeing it?

> As well as seeming to require some horrid (and replicated - probably
> elsewhere as well) code sequences that are likely (on the face of it)
> to get erronously copied to/from other places - especially since most of
> the code looks to be of the 'rarely executed' sort (where errors can
> remain hidden for years).

I have a theory that 97% of our error branches contain a bug because of
that reason.  I'm working on a proof ...

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"