Re: Mandatory locking?

1999-08-27 Thread Greg Lehey
a SMB an interface that has > to implement NetBIOS calls, and those, in turn, externalize via > the DOS INT 2A/2C mechanisms into the file I/O INTs, that SAMBA > has to support mandatory locking. How does it do this under FreeBSD? Does it implement it internally? > In effect, it is an API

Re: Mandatory locking?

1999-08-27 Thread Greg Lehey
On Wednesday, 25 August 1999 at 19:53:22 -0400, Christian Kuhtz wrote: > On Thu, Aug 26, 1999 at 09:09:33AM +0930, Greg Lehey wrote: >> On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: >>>> All the files under Tandem's NSK has mandatory l

Re: Mandatory locking?

1999-08-27 Thread Greg Lehey
a SMB an interface that has > to implement NetBIOS calls, and those, in turn, externalize via > the DOS INT 2A/2C mechanisms into the file I/O INTs, that SAMBA > has to support mandatory locking. How does it do this under FreeBSD? Does it implement it internally? > In effect, it is an API

Re: Mandatory locking?

1999-08-27 Thread Greg Lehey
On Wednesday, 25 August 1999 at 19:53:22 -0400, Christian Kuhtz wrote: > On Thu, Aug 26, 1999 at 09:09:33AM +0930, Greg Lehey wrote: >> On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: >>>> All the files under Tandem's NSK has mandatory l

Re: Mandatory locking?

1999-08-27 Thread Ville-Pertti Keinonen
th of whom explicitly stated that opening does not block. It had nothing to do with mandatory locking beyond that (quite possibly flawed) interpretation. > By your definiton of explicit, no. However, explicit locking is > voluntary, just as advisory locking is voluntary, in terms of > wh

Re: Mandatory locking?

1999-08-27 Thread Ville-Pertti Keinonen
th of whom explicitly stated that opening does not block. It had nothing to do with mandatory locking beyond that (quite possibly flawed) interpretation. > By your definiton of explicit, no. However, explicit locking is > voluntary, just as advisory locking is voluntary, in terms of > whethe

Re: Mandatory locking?

1999-08-26 Thread Terry Lambert
> I was assuming that mandatory locking, in the context of this > discussion, does not mean automatic, forced exclusion on open, but > rather explicit locks, applied by calls similar to those used for > advisory locking, that are enforced by the kernel. It's not mandatory, if

Re: Mandatory locking?

1999-08-26 Thread Terry Lambert
> I was assuming that mandatory locking, in the context of this > discussion, does not mean automatic, forced exclusion on open, but > rather explicit locks, applied by calls similar to those used for > advisory locking, that are enforced by the kernel. It's not mandatory, if

Re: Mandatory locking?

1999-08-26 Thread Ville-Pertti Keinonen
> Not to jump down your throat, or anything, but you seem to be > perpetuating some incorrct assumptions about both effect and > proposed implementation details, and they must be stomped. 8-). I was assuming that mandatory locking, in the context of this discussion, does not mean

Re: Mandatory locking?

1999-08-25 Thread Ville-Pertti Keinonen
> Not to jump down your throat, or anything, but you seem to be > perpetuating some incorrct assumptions about both effect and > proposed implementation details, and they must be stomped. 8-). I was assuming that mandatory locking, in the context of this discussion, does not mean

Re: Mandatory locking?

1999-08-25 Thread Christian Kuhtz
On Thu, Aug 26, 1999 at 09:09:33AM +0930, Greg Lehey wrote: > On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: > >> All the files under Tandem's NSK has mandatory locking. The file cannot be > >> opened if another process has it opened. some t

Re: Mandatory locking?

1999-08-25 Thread Greg Lehey
On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: >> All the files under Tandem's NSK has mandatory locking. The file cannot be >> opened if another process has it opened. some thing like >> >> * if the file is opened for reading, any one c

Re: Mandatory locking?

1999-08-25 Thread Christian Kuhtz
On Thu, Aug 26, 1999 at 09:09:33AM +0930, Greg Lehey wrote: > On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: > >> All the files under Tandem's NSK has mandatory locking. The file cannot be > >> opened if another process has it opened. some t

Re: Mandatory locking?

1999-08-25 Thread Greg Lehey
On Wednesday, 25 August 1999 at 6:05:11 -0400, Thomas David Rivers wrote: >> All the files under Tandem's NSK has mandatory locking. The file cannot be >> opened if another process has it opened. some thing like >> >> * if the file is opened for reading, any one c

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> The thing about well-intentioned but incorrect locking code is that > it will appear to work fine, until it trips over the one code path > where it forgets to lock some file that it should have locked. And > even then, the code will "work" just fine, until multiple processes > are accessing that

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> [Cc's trimmed] > > On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: > > > > > > > > How 'bout "anyone who can kill the process holding the lock?" > > > > > > + file owner ( + root ). > > > > Which processes can't root kill? > > Zombies? :) Kill their parents. Eventually, you wi

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> > All the files under Tandem's NSK has mandatory locking. The file cannot be > > opened if another process has it opened. some thing like > > > > * if the file is opened for reading, any one can open it for > > reading but opening for writing gives er

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
it takes to convince someone it really is useful. > > It should only take one, as long as the arguments made are not bogus. > > IMHO Greg made some very silly arguments (or at least used some very > stupid examples) for mandatory locking and never answered my points > regarding them.

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
zes via SMB an interface that has to implement NetBIOS calls, and those, in turn, externalize via the DOS INT 2A/2C mechanisms into the file I/O INTs, that SAMBA has to support mandatory locking. In effect, it is an API which externalizes much of the same types of operations that implement LEASE ope

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> The thing about well-intentioned but incorrect locking code is that > it will appear to work fine, until it trips over the one code path > where it forgets to lock some file that it should have locked. And > even then, the code will "work" just fine, until multiple processes > are accessing tha

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> [Cc's trimmed] > > On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: > > > > > > > > How 'bout "anyone who can kill the process holding the lock?" > > > > > > + file owner ( + root ). > > > > Which processes can't root kill? > > Zombies? :) Kill their parents. Eventually, you w

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
> > All the files under Tandem's NSK has mandatory locking. The file cannot be > > opened if another process has it opened. some thing like > > > > * if the file is opened for reading, any one can open it for > > reading but opening for writing gives er

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
it takes to convince someone it really is useful. > > It should only take one, as long as the arguments made are not bogus. > > IMHO Greg made some very silly arguments (or at least used some very > stupid examples) for mandatory locking and never answered my points > regarding th

Re: Mandatory locking?

1999-08-25 Thread Terry Lambert
zes via SMB an interface that has to implement NetBIOS calls, and those, in turn, externalize via the DOS INT 2A/2C mechanisms into the file I/O INTs, that SAMBA has to support mandatory locking. In effect, it is an API which externalizes much of the same types of operations that implement LEASE ope

Re: Mandatory locking?

1999-08-25 Thread Daniel C. Sobral
Greg Lehey wrote: > > On Wednesday, 25 August 1999 at 0:11:23 -0600, Wes Peters wrote: > > "Daniel C. Sobral" wrote: > >> > >> Christopher Masto wrote: > >>> > >>> I don't see the use for it. > >> > >> :-) > >> > >> The thing is SO obviously flawed, that I wonder how many marketoid > >> drones it

Re: Mandatory locking?

1999-08-25 Thread Daniel C. Sobral
Greg Lehey wrote: > > On Wednesday, 25 August 1999 at 0:11:23 -0600, Wes Peters wrote: > > "Daniel C. Sobral" wrote: > >> > >> Christopher Masto wrote: > >>> > >>> I don't see the use for it. > >> > >> :-) > >> > >> The thing is SO obviously flawed, that I wonder how many marketoid > >> drones i

Re: Mandatory locking?

1999-08-25 Thread Jamie Bowden
On Wed, 25 Aug 1999, Tim Vanderhoek wrote: :[Cc's trimmed] : :On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: :> > > :> > > How 'bout "anyone who can kill the process holding the lock?" :> > :> > + file owner ( + root ). :> :> Which processes can't root kill? : :Zombies? :) ps sho

Re: Mandatory locking?

1999-08-25 Thread Tim Vanderhoek
[Cc's trimmed] On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: > > > > > > How 'bout "anyone who can kill the process holding the lock?" > > > > + file owner ( + root ). > > Which processes can't root kill? Zombies? :) > > Otherwise I would be able to lock ~wes/FreeBSDmarkers a

Re: Mandatory locking?

1999-08-25 Thread Jamie Bowden
On Wed, 25 Aug 1999, Tim Vanderhoek wrote: :[Cc's trimmed] : :On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: :> > > :> > > How 'bout "anyone who can kill the process holding the lock?" :> > :> > + file owner ( + root ). :> :> Which processes can't root kill? : :Zombies? :) ps sh

Re: Mandatory locking?

1999-08-25 Thread Tim Vanderhoek
[Cc's trimmed] On Wed, Aug 25, 1999 at 12:15:24AM -0600, Wes Peters wrote: > > > > > > How 'bout "anyone who can kill the process holding the lock?" > > > > + file owner ( + root ). > > Which processes can't root kill? Zombies? :) > > Otherwise I would be able to lock ~wes/FreeBSDmarkers

Re: Mandatory locking?

1999-08-25 Thread Ville-Pertti Keinonen
(or at least used some very stupid examples) for mandatory locking and never answered my points regarding them. (The arguments of some of the ones opposing mandatory locking have been equally silly.) I *do* agree that mandatory locking *can* be useful, but the usefulness is not nearly as broad a

RE: Mandatory locking?

1999-08-25 Thread Thomas David Rivers
> All the files under Tandem's NSK has mandatory locking. The file cannot be > opened if another process has it opened. some thing like > > * if the file is opened for reading, any one can open it for > reading but opening for writing gives error > * if the file

Re: Mandatory locking?

1999-08-25 Thread Ville-Pertti Keinonen
(or at least used some very stupid examples) for mandatory locking and never answered my points regarding them. (The arguments of some of the ones opposing mandatory locking have been equally silly.) I *do* agree that mandatory locking *can* be useful, but the usefulness is not nearly as broad a

RE: Mandatory locking?

1999-08-25 Thread Thomas David Rivers
> All the files under Tandem's NSK has mandatory locking. The file cannot be > opened if another process has it opened. some thing like > > * if the file is opened for reading, any one can open it for > reading but opening for writing gives error > * if the file

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 0:11:23 -0600, Wes Peters wrote: > "Daniel C. Sobral" wrote: >> >> Christopher Masto wrote: >>> >>> I don't see the use for it. >> >> :-) >> >> The thing is SO obviously flawed, that I wonder how many marketoid >> drones it took to make sensible people think it is a

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
ting off the inevitable. In fact, this confusion with Vinum is more historical than anything. I started thinking "what tools are available for this as yet not clearly defined task that will run in user mode and require locking?". The obvious first question was "do we support read (

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Tim Vanderhoek wrote: > > On Tue, Aug 24, 1999 at 08:25:59AM -0600, Wes Peters wrote: > > > > > > I don't like restricting the breaking of mandatory locks to the > > > superuser. It could be restricted to specific users (say file owner + > > > root)... > > > > How 'bout "anyone who can kill the p

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
"Daniel C. Sobral" wrote: > > Christopher Masto wrote: > > > > I don't see the use for it. > > :-) > > The thing is SO obviously flawed, that I wonder how many marketoid > drones it took to make sensible people think it is actually useful. > :-) And how many programmers with nearly (or more tha

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Wes Peters
Sean Eric Fagan wrote: > > The fact that Greg thinks it's necessary and desirable (and he has > considerably more OS experience than a lot of the people who have decided it's > a stupid idea) should alone say a lot for the idea. I was waiting for someone else to bring up that point, because I migh

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 0:11:23 -0600, Wes Peters wrote: > "Daniel C. Sobral" wrote: >> >> Christopher Masto wrote: >>> >>> I don't see the use for it. >> >> :-) >> >> The thing is SO obviously flawed, that I wonder how many marketoid >> drones it took to make sensible people think it is

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Sean Eric Fagan
In article <19990825113518.d83273.kithrup.freebsd.cvs-...@freebie.lemis.com> you write: >Correct. I lock a stripe at a time. What people need to realize is that Greg is doing this locking in user mode. As such, he has two real options: 1. Implement a vinum-specific ioctl that locks a region o

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
sion with Vinum is more historical than anything. I started thinking "what tools are available for this as yet not clearly defined task that will run in user mode and require locking?". The obvious first question was "do we support read (i.e. mandatory) locking?". > Or does n

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Tim Vanderhoek wrote: > > On Tue, Aug 24, 1999 at 08:25:59AM -0600, Wes Peters wrote: > > > > > > I don't like restricting the breaking of mandatory locks to the > > > superuser. It could be restricted to specific users (say file owner + > > > root)... > > > > How 'bout "anyone who can kill the

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
"Daniel C. Sobral" wrote: > > Christopher Masto wrote: > > > > I don't see the use for it. > > :-) > > The thing is SO obviously flawed, that I wonder how many marketoid > drones it took to make sensible people think it is actually useful. > :-) And how many programmers with nearly (or more th

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Wes Peters
Sean Eric Fagan wrote: > > The fact that Greg thinks it's necessary and desirable (and he has > considerably more OS experience than a lot of the people who have decided it's > a stupid idea) should alone say a lot for the idea. I was waiting for someone else to bring up that point, because I mig

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Sean Eric Fagan
In article <[EMAIL PROTECTED]> you write: >Correct. I lock a stripe at a time. What people need to realize is that Greg is doing this locking in user mode. As such, he has two real options: 1. Implement a vinum-specific ioctl that locks a region of a file at the device level, or 2.

RE: Mandatory locking?

1999-08-24 Thread Biju Susmer
> > This isn't locking, it's access exclusion. It's also not correct for > NSK. what is the difference between locking and access exclusion? i was thinking both are same (locking implies access exclusion). in other words, My idea of mandatory locking is same as excl

RE: Mandatory locking?

1999-08-24 Thread Biju Susmer
> > This isn't locking, it's access exclusion. It's also not correct for > NSK. what is the difference between locking and access exclusion? i was thinking both are same (locking implies access exclusion). in other words, My idea of mandatory locking is same as excl

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 8:31:23 +0530, Biju Susmer wrote: > All the files under Tandem's NSK has mandatory locking. The file cannot be > opened if another process has it opened. some thing like > > * if the file is opened for reading, any one can open it for >

RE: Mandatory locking?

1999-08-24 Thread Biju Susmer
All the files under Tandem's NSK has mandatory locking. The file cannot be opened if another process has it opened. some thing like * if the file is opened for reading, any one can open it for reading but opening for writing gives error * if the file is open for writing, it can

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Tuesday, 24 August 1999 at 22:41:15 -0400, Albert D. Cahalan wrote: > > It is clear to me that BSD won't do this. SysV and Linux have > this feature. Linux runs everywhere that FreeBSD does and has > better features too... so why run BSD at all? I assume you're talking a

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Terry Lambert
> > I think what people are missing here is that Vinum, when doing > > software RAID, is implementing a type of namespace escape, only > > it isn't a standard namespace escape. > > Interesting terminology. I think you've lost most people already. I hope not. It's not that hard a concept. You c

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 8:31:23 +0530, Biju Susmer wrote: > All the files under Tandem's NSK has mandatory locking. The file cannot be > opened if another process has it opened. some thing like > > * if the file is opened for reading, any one can open it for >

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 1:52:38 +, Terry Lambert wrote: >>> I don't want to express an opinion about the need or otherwise >>> for mandatory locking, but I would appreciate a teensy >>> clarification of the problem domain: >>> >>> On

RE: Mandatory locking?

1999-08-24 Thread Biju Susmer
All the files under Tandem's NSK has mandatory locking. The file cannot be opened if another process has it opened. some thing like * if the file is opened for reading, any one can open it for reading but opening for writing gives error * if the file is open for writing, it can

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Terry Lambert
> > I don't want to express an opinion about the need or otherwise > > for mandatory locking, but I would appreciate a teensy > > clarification of the problem domain: > > > > On Mon, Aug 23, 1999 at 05:43:45PM +0930, Greg Lehey wrote: > >> To w

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
On Tuesday, 24 August 1999 at 22:41:15 -0400, Albert D. Cahalan wrote: > > It is clear to me that BSD won't do this. SysV and Linux have > this feature. Linux runs everywhere that FreeBSD does and has > better features too... so why run BSD at all? I assume you're talking a

Re: Mandatory locking?

1999-08-24 Thread Tim Vanderhoek
On Tue, Aug 24, 1999 at 05:51:54PM -0400, Tim Vanderhoek wrote: > > > > How 'bout "anyone who can kill the process holding the lock?" On further reflection, I'd go even further: anyone who can set the lock can break the lock. Presumably if they know enough to explicitly break the lock, then they

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Terry Lambert
> > I think what people are missing here is that Vinum, when doing > > software RAID, is implementing a type of namespace escape, only > > it isn't a standard namespace escape. > > Interesting terminology. I think you've lost most people already. I hope not. It's not that hard a concept. You

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
On Wednesday, 25 August 1999 at 1:52:38 +, Terry Lambert wrote: >>> I don't want to express an opinion about the need or otherwise >>> for mandatory locking, but I would appreciate a teensy >>> clarification of the problem domain: >>> >>> On

Re: Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Terry Lambert
> > I don't want to express an opinion about the need or otherwise > > for mandatory locking, but I would appreciate a teensy > > clarification of the problem domain: > > > > On Mon, Aug 23, 1999 at 05:43:45PM +0930, Greg Lehey wrote: > >> To w

Re: Mandatory locking?

1999-08-24 Thread Tim Vanderhoek
On Tue, Aug 24, 1999 at 05:51:54PM -0400, Tim Vanderhoek wrote: > > > > How 'bout "anyone who can kill the process holding the lock?" On further reflection, I'd go even further: anyone who can set the lock can break the lock. Presumably if they know enough to explicitly break the lock, then the

Re: Mandatory locking?

1999-08-24 Thread Chuck Robey
still stomp over User 1's data. No need to close > and reopen the file. > > Yes, it's WRONG code. Correct code would aquire a lock before > reading. My understanding of "mandatory locking" means that a program that completely ignores any locking at all, if it tries

Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
On Tuesday, 24 August 1999 at 10:59:34 +1000, Andrew Reilly wrote: > Hi Greg, hackers list, > > I don't want to express an opinion about the need or otherwise > for mandatory locking, but I would appreciate a teensy > clarification of the problem domain: > > On Mon,

Re: Mandatory locking?

1999-08-24 Thread Chuck Robey
still stomp over User 1's data. No need to close > and reopen the file. > > Yes, it's WRONG code. Correct code would aquire a lock before > reading. My understanding of "mandatory locking" means that a program that completely ignores any locking at all, if it tr

Locking in Vinum (was: Mandatory locking?)

1999-08-24 Thread Greg Lehey
On Tuesday, 24 August 1999 at 10:59:34 +1000, Andrew Reilly wrote: > Hi Greg, hackers list, > > I don't want to express an opinion about the need or otherwise > for mandatory locking, but I would appreciate a teensy > clarification of the problem domain: > > On Mon,

Re: Mandatory locking?

1999-08-24 Thread Tim Vanderhoek
On Tue, Aug 24, 1999 at 08:25:59AM -0600, Wes Peters wrote: > > > > I don't like restricting the breaking of mandatory locks to the > > superuser. It could be restricted to specific users (say file owner + > > root)... > > How 'bout "anyone who can kill the process holding the lock?" + file ow

Re: Mandatory locking?

1999-08-24 Thread Tim Vanderhoek
On Tue, Aug 24, 1999 at 08:25:59AM -0600, Wes Peters wrote: > > > > I don't like restricting the breaking of mandatory locks to the > > superuser. It could be restricted to specific users (say file owner + > > root)... > > How 'bout "anyone who can kill the process holding the lock?" + file o

Re: Mandatory locking?

1999-08-24 Thread Christopher Masto
On Tue, Aug 24, 1999 at 11:33:33AM -0400, Chuck Robey wrote: > > Yes, it's WRONG code. Correct code would aquire a lock before > > reading. > > My understanding of "mandatory locking" means that a program that > completely ignores any locking at all, if it

Re: Mandatory locking?

1999-08-24 Thread Garance A Drosihn
At 11:17 AM -0400 8/24/99, Christopher Masto wrote: I'm sure there are situations where mandatory locking accomplishes something useful. Are they worth it? (I don't claim to know; if the problems I thought I pointed out don't really exist, good.) More seriously than just b

Re: Mandatory locking?

1999-08-24 Thread Garance A Drosihn
At 11:27 PM -0400 8/23/99, Christopher Masto wrote: On Mon, Aug 23, 1999 at 11:16:21PM -0400, Chuck Robey wrote: > What has that code you show above got to do with mandatory locking? > You completely missed the explicit locking calls that you have to make, > to get and release the locks

Re: Mandatory locking?

1999-08-24 Thread Christopher Masto
On Tue, Aug 24, 1999 at 11:33:33AM -0400, Chuck Robey wrote: > > Yes, it's WRONG code. Correct code would aquire a lock before > > reading. > > My understanding of "mandatory locking" means that a program that > completely ignores any locking at all, if it

Re: Mandatory locking?

1999-08-24 Thread Garance A Drosihn
At 11:17 AM -0400 8/24/99, Christopher Masto wrote: >I'm sure there are situations where mandatory locking accomplishes >something useful. Are they worth it? (I don't claim to know; if >the problems I thought I pointed out don't really exist, good.) > >More seriou

Re: Mandatory locking?

1999-08-24 Thread Andrew Kenneth Milton
s a mutex on a part/whole file. Mandatory locking enables a process to ensure that its transaction is safe from interference. Interference that can come from a correctly running program writing at the wrong time (but not using the locks -- maybe you don't have source for it either). What happens i

Re: Mandatory locking?

1999-08-24 Thread Andrew Kenneth Milton
s a mutex on a part/whole file. Mandatory locking enables a process to ensure that its transaction is safe from interference. Interference that can come from a correctly running program writing at the wrong time (but not using the locks -- maybe you don't have source for it either). What happens i

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
Chuck Robey wrote: > > On Mon, 23 Aug 1999, Christopher Masto wrote: > > > Bleah.. I can't count the number of times I've seen idiotic code like: > > > > open file > > read data > > close file > > open file for write > > write da

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
Christopher Masto wrote: > > Exactly. You said that mandatory locking means that user A's correct > use of locking means that user B doesn't have to be careful. That's > not the case, since A can step in between B's read and write. A's > mandatory loc

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
is that > it will appear to work fine, until it trips over the one code path > where it forgets to lock some file that it should have locked. And > even then, the code will "work" just fine, until multiple processes > are accessing that file at the same time. A well-intentione

Re: Mandatory locking?

1999-08-24 Thread Garance A Drosihn
At 11:27 PM -0400 8/23/99, Christopher Masto wrote: >On Mon, Aug 23, 1999 at 11:16:21PM -0400, Chuck Robey wrote: > > What has that code you show above got to do with mandatory locking? > > You completely missed the explicit locking calls that you have to make, > > to get

Re: Mandatory locking?

1999-08-24 Thread Christopher Masto
On Tue, Aug 24, 1999 at 08:35:25AM -0600, Wes Peters wrote: > You've got this so wrong, perhaps you should just go find a System V man > page and read about mandatory locking before embarassing yourself any- > more. First of all, when was it decided that we were all talking abou

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
visory locking. You've got this so wrong, perhaps you should just go find a System V man page and read about mandatory locking before embarassing yourself any- more. Locking will only block if another process is holding an overlapping lock. opening won't block due to mandatory locking.

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Christopher Masto wrote: > > > The thing about well-intentioned but incorrect locking code is that > > it will appear to work fine, until it trips over the one code path > > where it forgets to lock some file that it should have locked. And > > even then, the code will "work" just fine, until mul

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Tim Vanderhoek wrote: > > On Mon, Aug 23, 1999 at 10:12:38PM +0200, Mark Murray wrote: > > > > In process-space, this is the kernel. In file-space, this should > > be root. Processes that require mandatory locking must revoke > > superuser before attempting locks.

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
Christopher Masto wrote: > > Exactly. You said that mandatory locking means that user A's correct > use of locking means that user B doesn't have to be careful. That's > not the case, since A can step in between B's read and write. A's > mandatory loc

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
Chuck Robey wrote: > > On Mon, 23 Aug 1999, Christopher Masto wrote: > > > Bleah.. I can't count the number of times I've seen idiotic code like: > > > > open file > > read data > > close file > > open file for write > > write da

Re: Mandatory locking?

1999-08-24 Thread Daniel C. Sobral
is that > it will appear to work fine, until it trips over the one code path > where it forgets to lock some file that it should have locked. And > even then, the code will "work" just fine, until multiple processes > are accessing that file at the same time. A well-intenti

Re: Mandatory locking?

1999-08-24 Thread Christopher Masto
On Tue, Aug 24, 1999 at 08:35:25AM -0600, Wes Peters wrote: > You've got this so wrong, perhaps you should just go find a System V man > page and read about mandatory locking before embarassing yourself any- > more. First of all, when was it decided that we were all talking abou

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Tim Vanderhoek wrote: > > On Mon, Aug 23, 1999 at 10:12:38PM +0200, Mark Murray wrote: > > > > In process-space, this is the kernel. In file-space, this should > > be root. Processes that require mandatory locking must revoke > > superuser before attempting locks.

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
Christopher Masto wrote: > > > The thing about well-intentioned but incorrect locking code is that > > it will appear to work fine, until it trips over the one code path > > where it forgets to lock some file that it should have locked. And > > even then, the code will "work" just fine, until mu

Re: Mandatory locking?

1999-08-24 Thread Wes Peters
sing advisory locking. You've got this so wrong, perhaps you should just go find a System V man page and read about mandatory locking before embarassing yourself any- more. Locking will only block if another process is holding an overlapping lock. opening won't block due to mandatory locking

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
ly end up with a broken mailbox. >> >> what you do is this: >> lockf -k $mailfile cat ${mailtmp} >> $mailfile > > Which doesn't support Greg's arguments for mandatory locking, as > you're now doing locking in both programs. Well, it doesn't supp

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
sendmail delivers new mail > > sendmail unlocks /var/mail/grog > > cat writes the rest of oldmail to /var/mail/grog > > > > You'll still probably end up with a broken mailbox. > > what you do is this: > lockf -k $mailfile cat ${mailtmp} >> $mai

Re: Mandatory locking?

1999-08-24 Thread John-Mark Gurney
orks, but it's playing with fire: if sendmail is delivering a > > message at the same time, it won't see me, and my cat doesn't get a > > lock beforehand, so both an incoming message and part of my mail > > folder could end up getting written to the same location.

Re: Mandatory locking?

1999-08-24 Thread Greg Lehey
ly end up with a broken mailbox. >> >> what you do is this: >> lockf -k $mailfile cat ${mailtmp} >> $mailfile > > Which doesn't support Greg's arguments for mandatory locking, as > you're now doing locking in both programs. Well, it doesn't supp

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
sendmail delivers new mail > > sendmail unlocks /var/mail/grog > > cat writes the rest of oldmail to /var/mail/grog > > > > You'll still probably end up with a broken mailbox. > > what you do is this: > lockf -k $mailfile cat ${mailtmp} >> $mai

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
t won't see me, and my cat doesn't get a > lock beforehand, so both an incoming message and part of my mail > folder could end up getting written to the same location. With > mandatory locking, it would work, transparently. Certainly not with range-locking rather than file-lo

Re: Mandatory locking?

1999-08-24 Thread John-Mark Gurney
t; That works, but it's playing with fire: if sendmail is delivering a > > message at the same time, it won't see me, and my cat doesn't get a > > lock beforehand, so both an incoming message and part of my mail > > folder could end up getting written to the same location.

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
chu...@picnic.mat.net (Chuck Robey) writes: > On 23 Aug 1999, Ville-Pertti Keinonen wrote: > > And even without otherwise incorrect behavior, if you have a program > > that doesn't use any locking and another one that uses mandatory > > locking to prevent races with th

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
e, it won't see me, and my cat doesn't get a > lock beforehand, so both an incoming message and part of my mail > folder could end up getting written to the same location. With > mandatory locking, it would work, transparently. Certainly not with range-locking rather than file-lo

Re: Mandatory locking?

1999-08-24 Thread Ville-Pertti Keinonen
[EMAIL PROTECTED] (Chuck Robey) writes: > On 23 Aug 1999, Ville-Pertti Keinonen wrote: > > And even without otherwise incorrect behavior, if you have a program > > that doesn't use any locking and another one that uses mandatory > > locking to prevent races with th

  1   2   >