From owner-freebsd-hackers Tue Jul 1 15:43:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA27406 for hackers-outgoing; Tue, 1 Jul 1997 15:43:34 -0700 (PDT) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA27396 for ; Tue, 1 Jul 1997 15:43:31 -0700 (PDT) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id PAA11743; Tue, 1 Jul 1997 15:36:00 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpd011741; Tue Jul 1 22:35:57 1997 Message-ID: <33B985FA.3F54BC7E@whistle.com> Date: Tue, 01 Jul 1997 15:34:34 -0700 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: Terry Lambert CC: Sebastian Lederer , freebsd-hackers@FreeBSD.ORG Subject: POSIX locking ( was NFS locking) References: <199707012024.NAA27875@phaeton.artisoft.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert wrote: > > > Let me see if I understand all issues correctly: > > > > > 1) The POSIX semantics make it difficult for rpc.lockd > > > to have only one file handle per file regardless of > > > the number of clients with the file open. This is > > >[...] > > > > So the rpc.lockd (on the server) would have to keep a list of all active > > locks on a file and only close the file when all locks are cleared. > > No. The rpc.lockd could not convert a handle into an fd, and > subsequently close the fd, until all fd's for that file had been > closed by all clients. basically the posix locking is a pain in the rear-end. It's quite amazing that they managed to get something SO WRONG without being stopped in the process by at least one person with a clue. SAMBA has to go to great lengths to get around this.. I suggest that we have a per-process flag that allows the locks to be done per-fd. it would break posix, but if you had posix by default, and this only if you set it, then it would still be posix complient. such things as samba and nfslockd could flip the bit and get useful semantics. Anyone think this is a TERRIBLE idea? certainly Once the semantics and mechanism of 'turning the bit on' were settled, the code changes would be quite easy. I'm sure the same interface could be added to Linux if the samba people asked for it (and I know they would).