[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gfs-devel
Subject:    Re: [gfs-devel] fcntl locks
From:       Mike Tilstra <conrad () sistina ! com>
Date:       2001-01-09 17:53:00
[Download RAW message or body]

On Tue, Jan 09, 2001 at 06:23:02PM +0100, christophe barbe wrote:
> When can we expect a full fcntl lock support in GFS?
I believe fcntl locking will be ready in a 4.1 release.  Which hopefully
will not be too far behind teh 4.0 release.

> To provide a temporary solution when only complete file locking is
> required (no partial file locking), I 've used the actual code for flock
> and rejecting locking request when they don't concern a whole file. It
> works but it not a good way to do it. If you want I can send you the
> patch but IMHO it's not a good thing for the CVS tree.
I'd like to see the patch.  Even if its not a good thing for the CVS tree.

> I'm looking for good references which explain the differences between
> the fcntl approach and the flock one, ideally with reference's
> implementation (otherwise I've the linux source). So if you know some
> good books and/or good urls, please mail me.
heh, I'd love to have something like this as well.  I've been bassing most
of my stuff right now on the linux kernel source, and "Advanced Programming
in the UNIX Environment" by W. Richard Stevens.

> In my understanding, fcntl provides mandatory locks (if specified with
> the file's permission) and flock is only advisory. Each kind of lock
> simply ignore the other king except if fcntl is mandatory.
I'm pretty sure that fcntl lock are not mandatory.  They can be, but don't
have to.  The first version in GFS will most likely not support mandatory
locking.  (But can be working in later.)

> In NFS, only fcntl is available. I remember a nfs thread where it was
> discussed the flock unavailability. The conclusion was not clear. IIRC
> it was that only fcntl should go through the network. The use of fcntl
> to provide a flock was discussed too but the conclusion was that it was
> not easy because of some misterious difficulties.

AFAIK, the misterious difficulties are when you look at what happens when
you start dupping and forking and closing file descriptors with locks on
them.  flocks and fcntl locks behave very differently in these situations.

later,
--=20
Michael Tilstra                       conrad@sistina.com
Matter cannot be created or destroyed, nor can it be returned without a
receipt.

[Attachment #3 (application/pgp-signature)]
_______________________________________________
gfs-devel mailing list
gfs-devel@sistina.com
http://lists.sistina.com/mailman/listinfo/gfs-devel
Read the GFS Howto:  http://www.sistina.com/gfs/Pages/howto.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic