Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mulga.OZ Path: utzoo!linus!decvax!mulga!kre From: kre@mulga.OZ (Robert Elz) Newsgroups: net.bugs.4bsd Subject: 4.2 disk quota bug setting quotas for logged in users (FIX) Message-ID: <463@mulga.OZ> Date: Mon, 1-Oct-84 06:38:36 EDT Article-I.D.: mulga.463 Posted: Mon Oct 1 06:38:36 1984 Date-Received: Mon, 8-Oct-84 04:48:59 EDT Organization: Comp Sci, Melbourne Uni, Australia Lines: 47 Index: sys/quota_sys.c 4.2bsd FIX Description: If you attempt to set a new disk quota on a user who has recently deleted some files, the system will quite likely soon panic with "maknode: dquot". This has been known to appear as if the problem is setting disk quotas of a user who is logged in. Repeat-By: Find some user who has no quotas, have him log in & delete some files (create them first if necessary) then set quotas on that filesystem (the one that files were deleted on). Have the user create the files again (any contents, or none). Unless you're very lucky, you will get a panic("maknode: dquot"). (Of course, the system may have panic'd because of some other user creating a file before you get a chance). Fix: The following diff is to sys/quota_sys.c, the line numbers are most probably way out, but its right near the end of function setdlim() (last 10 lines). First piece of text is the old (buggy) version, second is the fixed one. *** /tmp/quota_sys.c Mon Oct 1 05:27:25 1984 --- quota_sys.c Sun Jul 15 07:13:23 1984 *************** *** 171,177 if (dq == odq) return (error); for (ip = inode; ip < inodeNINODE; ip++) ! if (ip->i_uid == q->q_uid && ip->i_dev == dev) { if (dq == NODQUOT) dqrele(ip->i_dquot); else --- 171,177 ----- if (dq == odq) return (error); for (ip = inode; ip < inodeNINODE; ip++) ! if (ip->i_uid == q->q_uid && ip->i_dev == dev && ip->i_mode) { if (dq == NODQUOT) dqrele(ip->i_dquot); else Robert Elz decvax!mulga!kre