Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jun 1999 16:25:54 -0400
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        Greg Black <gjb@acm.org>
Cc:        "David E. Cross" <crossd@cs.rpi.edu>, freebsd-hackers@FreeBSD.ORG, crossd@cs.rpi.edu
Subject:   Re: 3.2-stable, panic #12 
Message-ID:  <199906042025.QAA56354@cs.rpi.edu>
In-Reply-To: Message from Greg Black <gjb@acm.org>  of "Fri, 04 Jun 1999 19:18:56 %2B1000." <19990604091857.25082.qmail@alice.gba.oz.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >                 fd=open(argv[1], O_CREAT, 600);
> 
> Since this opens the file so that it cannot be written to, not
> to mention the really weird mode it will get if it's created by
> that open(), the rest of the thing doesn't deserve to work.
> 
> Generally speaking, it's a good idea to make sure that test code
> is at least decent before starting to puzzle over what it does.

The code does exactly what it is supposed to.  The "600" was a typo that
should be "0600".  If it makes you feel better s/O_CREAT/O_CREAT|O_RDWR/;
the results are the same, the server crashes with a lockmgr: locking against
myself panic, a panic that we have seen !13! times in the past 10 days.  I
would certainly hope and expect it to work (what do you know, it does),
considering "the rest" is a simple unlink of the file that _I_ just created.  I
do not understand why you believe it "does not deserve to work".  

The ONLY purpose of this code was to create a regular file, unlink it, and then
create it again as quickly as possible under the same name.  For this purpose
the mode is irrelevant, and the R/W status of the FD is irrelevant; the code
fulfills its purpose, and in doing so exhibits the aforementioned bug.

Generally speaking, you should test the code to see if it works as advertised
before trying to fix it.  Did this code crash your system when run from 2
solaris 2.6 machines?
--
David Cross                               | email: crossd@cs.rpi.edu 
Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd 
Rensselaer Polytechnic Institute,         | Ph: 518.276.2860            
Department of Computer Science            | Fax: 518.276.4033
I speak only for myself.                  | WinNT:Linux::Linux:FreeBSD


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906042025.QAA56354>