Re: Is mkdir guaranteed to be 'atomic' ??

2001-03-01 Thread void
On Mon, Feb 26, 2001 at 02:10:47PM -0800, Mike Smith wrote: Well, imagine a hypothetical broken system in which two simultaneous calls to mkdir, on some hypothetical broken filesystem, can each think that it "succeeded". After all, at the end of the operation, the directory has been

Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Marc W
hi! i can never really tell if this alias is for discussions concerning development OF the FreeBSD OS or development ON the FreeBSD OS (or both), but I figure i'll risk the wrath of the anti-social and ask a coupla programming questions :-) is mkdir(3) guaranteed to be atomic? Thus

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Drew Eckhardt
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes : is mkdir(3) guaranteed to be atomic? Yes. Are there filesystem type cases where this might not be the case (NFS being my main concern ) No. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-ha

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Nate Williams
is mkdir(3) guaranteed to be atomic? Yes. Are there filesystem type cases where this might not be the case (NFS being my main concern ) No. Yes. NFS doesn't guarantee atomicity, because it can't. If the mkdir call returns, you have no guarantee that the remote directory

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Marc W
- From: Nate Williams [EMAIL PROTECTED] Are there filesystem type cases where this might not be the case (NFS being my main concern ) No. Yes. NFS doesn't guarantee atomicity, because it can't. If the mkdir call returns, you have no guarantee

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Nate Williams
Are there filesystem type cases where this might not be the case (NFS being my main concern ) No. Yes. NFS doesn't guarantee atomicity, because it can't. If the mkdir call returns, you have no guarantee that the remote directory has been created (caching, errors,

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Mike Smith
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes : is mkdir(3) guaranteed to be atomic? Yes. Um. mkdir(2) is atomic. Note that mkdir(1) with the -p argument is *not* atomic. Are there filesystem type cases where this might not be the case (NFS being my main concern

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Peter Seebach
In message [EMAIL PROTECTED], Mike Smith writes: How would it *not* be atomic? Well, imagine a hypothetical broken system in which two simultaneous calls to mkdir, on some hypothetical broken filesystem, can each think that it "succeeded". After all, at the end of the operation, the directory

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Marc W
I can handle it if there is a case where both fail, but is there a case where both can SUCCEED ?? What do you mean 'both succeed'? My understanding is that, on non-broken filesystems, calls to mkdir(2) either succeed by creating a new directory, or fail and return EEXIST

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Nate Williams
I can handle it if there is a case where both fail, but is there a case where both can SUCCEED ?? What do you mean 'both succeed'? My understanding is that, on non-broken filesystems, calls to mkdir(2) either succeed by creating a new directory, or fail and return EEXIST

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Mike Smith
In message [EMAIL PROTECTED], Mike Smith writes: How would it *not* be atomic? Well, imagine a hypothetical broken system in which two simultaneous calls to mkdir, on some hypothetical broken filesystem, can each think that it "succeeded". After all, at the end of the operation, the

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Lyndon Nerenberg
"Peter" == Peter Seebach [EMAIL PROTECTED] writes: Peter Well, imagine a hypothetical broken system in which two Peter simultaneous calls to mkdir, on some hypothetical broken Peter filesystem, can each think that it "succeeded". After all, Peter at the end of the operation,

Re: Is mkdir guaranteed to be 'atomic' ??

2001-02-26 Thread Matt Dillon
(owner-freebsd-hackers removed from list) :You're implying that you are making two calls to create the same :directory. Am I correct? : :The answer is 'maybe'? Depends on the remote NFS server. Matt or one :of the other NFS gurus may know more, but I wouldn't count on *anything* :over