gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: [BUG] FEATURE PLANS: revlib locking


From: Sylvain Defresne
Subject: Re: [Gnu-arch-users] Re: [BUG] FEATURE PLANS: revlib locking
Date: Fri, 04 Jun 2004 21:42:51 +0200

Hello,

> The schema proposed is:
>     1) Client creates a file with unique name on server. Retries as
>        required.
>     2) Client requests to link this file to the lockfile name. Retries
>        until it gets a reply.
>     3) Client IGNORES the reply, unless it is a permanent error
>        (permissions, wrong path).

What if the two clients select the same random unique name (it may
happen) and the NFS server does not honour the O_EXCL flag to open
(somebody said that it is the case for linux 2.4) ? Won't the link call
fails for one of the client with EEXIST error, and if they discard the
error code, they will both think they have succeeded since the link
count will be of two for the unique file ?

>     4) Client stat's the temporary file it created in step 1. Retries as
>        required.
>     5) 
>        - If the reply is 2, the lock is taken. Enters critical section.
>        - If the reply is 1, someone else has the lock. Wait a short
>        while and repeat from step 2.

I'm I wrong, or can this happens ? If yes, then the two process will
enter the critical section at once, which can be bad ...
-- 
Sylvain Defresne                               <address@hidden>
1024D/A036DDB1 6AB9 B65F 7C44 819F DD42  62D2 A093 2840 A036 DDB1

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]