Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 1999 16:28:13 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, FreeBSD Hackers <hackers@FreeBSD.ORG>, FreeBSD Committers <cvs-committers@FreeBSD.ORG>, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Subject:   Re: Mandatory locking?
Message-ID:  <19990823162813.I83273@freebie.lemis.com>
In-Reply-To: <7324.935390854@critter.freebsd.dk>; from Poul-Henning Kamp on Mon, Aug 23, 1999 at 08:47:34AM %2B0200
References:  <19990823152849.H83273@freebie.lemis.com> <7324.935390854@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 23 August 1999 at  8:47:34 +0200, Poul-Henning Kamp wrote:
> In message <19990823152849.H83273@freebie.lemis.com>, Greg Lehey writes:
>
>>> Why should it be made unavailable ?
>>
>> So that certain multiple accesses can be done atomically.
>
> You don't need that.  You initialize a index to 0, and whenever the
> sector with that index is written, you increment it.
>
> At any one time you know that all parityblocks <= your index
> are valid.

Sure, that's pretty much what I do in the situation you're thinking
about.  But it won't work without locking.  Take a look at
vinumrevive.c and vinumrequest.c.

My real question was more like "OK, I have a situation coming up in
which I need to be able to lock out other processes.  What tools are
available for it".  I don't know yet whether what I end up with can be
solved by this method, but it's nice to know what tools you have.  You
certainly wouldn't want to lock out access to the entire device during
this time.

>> I'm a little surprised that there's any objection to the concept of
>> mandatory locking.
>
> Too many of us have had wedged systems because of it I guess...

Strange, I've probably used it more than anybody here, and I've never
had a wedged system.  Of course, you need to use it appropriately.
'rm' can be a lethal tool :-)

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


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?19990823162813.I83273>