From owner-freebsd-hackers Wed Aug 25 12: 5:41 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (Postfix) with ESMTP id DE03014C31 for ; Wed, 25 Aug 1999 12:05:30 -0700 (PDT) (envelope-from tlambert@usr08.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id MAA17636; Wed, 25 Aug 1999 12:05:25 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp01.primenet.com, id smtpd017616; Wed Aug 25 12:05:22 1999 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id MAA08521; Wed, 25 Aug 1999 12:05:15 -0700 (MST) From: Terry Lambert Message-Id: <199908251905.MAA08521@usr08.primenet.com> Subject: Re: Mandatory locking? To: rivers@dignus.com (Thomas David Rivers) Date: Wed, 25 Aug 1999 19:05:15 +0000 (GMT) Cc: bee@wipinfo.soft.net, hackers@FreeBSD.ORG In-Reply-To: <199908251005.GAA95394@lakes.dignus.com> from "Thomas David Rivers" at Aug 25, 99 06:05:11 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > All the files under Tandem's NSK has mandatory locking. The file cannot be > > opened if another process has it opened. some thing like > > > > * if the file is opened for reading, any one can open it for > > reading but opening for writing gives error > > * if the file is open for writing, it can't be opened for > > read/write > > * if the process holding the file is killed, the lock is gone > > * it is possible to get the pid of the process(es) which has > > a given file open (like which process has file "xyz" open? > > kind of query). btw, is there any way to get this info now in FBSD? > > This sounds interesting... > > But - aren't there NFS issues? I mean, in stateless access to > a file - how do you know if the process holding the file is killed > if it's remote? The remote lockd tells your local lockd about it. If the remote system dies entirely, your statd tells you about it. Mandatory locking via SGID/SUID bits works over NFS, so long as locking works over NFS, and so long as both the client and the server implement the same feature signalling mechanism. Yet another reason to not go the chflags/open parameter route, since neither can be communicated well over NFS. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message