On Wed, Jul 22, 2015 at 4:25 PM, Pommier, Rex <[email protected]> wrote:
> <snip> > > > I don't know about anybody else here but I much prefer z/OS making me jump > through a hoop or two before deleting a dataset that has an enqueue on it > than UNIX which allows (or at least it did somewhat recently) me to delete > a file that is open/in use/actively being updated by somebody else. > What is worse is the total lack of a _system level_ interlock on an inode (which is a subtle difference from a "file"). This means that I can run multiple "update" jobs concurrently and totally hose up the contents. This is _somewhat_ mitigated by the fact that all local references (a file descriptor) to an inode are actually, in effect, "pointers" to a global "open inode" table in the kernel. Which means that the system I/O buffer is shared. There is a type of "locking" for inodes, but it is discretionary and not mandatory. IMO, not sufficient. The ability to "delete a file" (actually unlink a directory entry) while it is open does have one nice effect (FSVO "nice"). A program which needs a temporary disk work area (there are no &&TEMP type file names in UNIX) can do an open() with OCREAT+OEXCL to atomically create and open a new file. If the file exists, the open() fails. If it succeeds, the code can then immediately unlink() the entry. This removes the name from the directory, but the inode on disk still exists and can be used just like any normal file, including normal expansion. The need for this, in UNIX, is that there is nothing like OS/360's DISP parameter to automatically delete a file name when the program ends. And, unlike OS/360 et al., if the entire system crashes, the inode will be automatically removed when the system is rebooted, and an fsck is done when the filesystem is mounted. I will grant that z/OS very rarely fails and leave temporary data sets on the work volumes. I have _no_ idea why the creators of UNIX never came up with the equivalent of an ENQ. And I don't think that other types of locks are as good (e.g. have a directory called /enq and try to atomically create and open a "resource name" as a file name, failing if the open() fails.) Well just my meanderings. > > Rex > > -- Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
