nmh-workers
[Top] [All Lists]

Re: locking rcvstore?

2002-07-12 13:03:09
On July 12, 2002 at 10:18, Neil W Rickert wrote:

That should not be possible.  I haven't looked at the code.  But it
should be opening the file with "O_CREAT", which should fail if the
message already exists.

I think you mean "O_CREAT|O_EXCL".


Unless there are major code deficiencies, creating new messages
should depend on the atomicity of unix file creation.  No additional
locking should be required.  That is supposed to be one of the
benefits of one message per file.

So how is message number (filename) determined?  If a open()
fails to pre-existance, does inc re-read the directory to determine
the next message number, or does it just keep incrementing the
number to something works?

It seems that the only real place that locking is needed is
for the .mh_sequences file.  I.e.  The use of locking can be
limited to areas where there is no non-locking method available
to prevent corruption.

--ewh

P.S.  Somebodies formatting of the References: field is messed up.
Only message-ids should be present.


<Prev in Thread] Current Thread [Next in Thread>