Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 1999 08:31:23 +0530
From:      "Biju Susmer" <bee@wipinfo.soft.net>
To:        "'FreeBSD Hackers'" <hackers@FreeBSD.ORG>
Subject:   RE: Mandatory locking?
Message-ID:  <000301beeea6$1ea898a0$88291fac@wipro.tcpn.com>
In-Reply-To: <19990824214523.A11992@ppp18415.on.bellglobal.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?

Also, file need not be explicitly locked. Opening a file puts proper lock. A
file which is open can't be deleted also ;)

This kind of locking will solve most of the problems which are pointed out.
Mandatory locking on a part of the file is in no way better than advisory
locking.

All the files need not have this option. there must be a way to specify that
"this file needs mandatory locking" to the kernel.

I don't know what all changes are needed in the kernel.. but I'm thinking about
dup() and fork().. What is the fate of the lock if the process does a fork()?

I hope this makes sense..
-Biju






To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000301beeea6$1ea898a0$88291fac>