Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!apple!sun-barr!newstop!texsun!texbell!uudell!bigtex!james From: james@bigtex.cactus.org (James Van Artsdalen) Newsgroups: comp.unix.i386 Subject: Re: "bad ulimit" on all non-root "at" & "batch" jobs under 386/ix Message-ID: <29025@bigtex.cactus.org> Date: 6 Feb 90 02:54:09 GMT References: <558@hades.OZ> <1990Jan17.002348.11507@virtech.uucp> <2836@auspex.auspex.com> <1990Jan25.132121.11344@virtech.uucp> <28222@bigtex.cactus.org> <1990Jan30.142000.5253@virtech.uucp> <28606@bigtex.cactus.org> <1990Feb3.003112.22012@virtech.uucp> Reply-To: james@bigtex.cactus.org (James Van Artsdalen) Organization: Institute of Applied Cosmology, Austin TX Lines: 32 In <1990Feb3.003112.22012@virtech.uucp>, cpcahil@virtech.UUCP (Conor P. Cahill) wrote: > In article <28606@bigtex.cactus.org> james@bigtex.cactus.org (me) wrote: | If the AT&T programmer had thought correctly, they would have realized | that the correct thing to do would be to (1) count blocks actually | allocated so that a program would really be allowed to write it's full | ulimit. > To implement this change they would have to do one of the following: > > 1. change the file system inode so that it now has a slot to > keep the "real" size of the file (# of used datablocks). > and make the appropriate kernel stuff to keep track of this > stuff and update the disk inode. This sounds like much too much effort. When I said I didn't care how big the files were, just how much was written, and I meant it: file size has nothing to do with limiting a user's disk consumption. Keep a vector, indexed on uid, of how many blocks each uid allocates, incrementing the count each time a new block is allocated, decrementing on unlink. I'll go out on a limb, not having looked at this source, but I'll bet there's one place in the generic write(2) and unlink(2) code that can do this (arguably directory files should be handled too). No need to muck with the inode structure. You do need a way to initialize this structure, via login(1) I suppose. Gee, sounds more and more like quota. -- James R. Van Artsdalen james@bigtex.cactus.org "Live Free or Die" Dell Computer Co 9505 Arboretum Blvd Austin TX 78759 512-338-8789