Article View: comp.bugs.4bsd
Article #190reno kernel `panic: missing dquot' when turning on accounting
From: Chris Torek
Date: Wed, 22 Aug 1990 18:17
Date: Wed, 22 Aug 1990 18:17
92 lines
2967 bytes
2967 bytes
Index: sys/kern/kern_acct.c 4.3BSD-reno Fix
Description:
If you have compiled your kernel with the DIAGNOSTIC option,
quotas are enabled on some file system, and accounting is
subsequently enabled on that file system, the kernel will panic
with `missing dquot' as soon as a process exits.
Repeat-by:
[compile with `options DIAGNOSTIC'; set up quotas for /var]
# quotaon /var
# accton /var/adm/acct
# (exit)
[machine crashes]
Fix:
The problem is that the accounting code does not honor the
normal vnode open protocol. In particular, it never calls
the vnode's access operation. This is where the ufs code
reads the quotas for a file system, since only files that
are being written will ever have a quota change.
No panic occurs if quotas are enabled *after* turning on
accounting, because then the quota code attaches the dquot
structures directly (by scanning all vnodes on that
particular file system). However, in this case the
access and open operations still have not been called,
so a file system type that uses these operations (e.g.,
a Sprite-like system) would cause trouble if it were used
for accounting.
The line numbers below are off by one from the actual Reno
distribution.
RCS file: RCS/kern_acct.c,v
retrieving revision 1.3
diff -c2 -r1.3 kern_acct.c
*** /tmp/,RCSt1000479 Wed Aug 22 14:10:38 1990
--- kern_acct.c Wed Aug 22 14:10:24 1990
***************
*** 17,20 ****
--- 17,21 ----
#include "mount.h"
#include "kernel.h"
+ #include "file.h"
#include "acct.h"
#include "uio.h"
***************
*** 57,61 ****
savacctp = NULL;
}
! if (uap->fname==NULL) {
if (vp = acctp) {
acctp = NULL;
--- 58,62 ----
savacctp = NULL;
}
! if (uap->fname == NULL) {
if (vp = acctp) {
acctp = NULL;
***************
*** 65,72 ****
return (0);
}
- ndp->ni_nameiop = LOOKUP | FOLLOW;
ndp->ni_segflg = UIO_USERSPACE;
ndp->ni_dirp = uap->fname;
! if (error = namei(ndp))
return (error);
vp = ndp->ni_vp;
--- 66,72 ----
return (0);
}
ndp->ni_segflg = UIO_USERSPACE;
ndp->ni_dirp = uap->fname;
! if (error = vn_open(ndp, FWRITE, 0644))
return (error);
vp = ndp->ni_vp;
***************
*** 74,81 ****
vrele(vp);
return (EACCES);
- }
- if (vp->v_mount->mnt_flag & MNT_RDONLY) {
- vrele(vp);
- return (EROFS);
}
oacctp = acctp;
--- 74,77 ----
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750)
Domain: chris@cs.umd.edu Path: uunet!mimsy!chris
Technical Details
Message-ID:
<26129@mimsy.umd.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!aplcen!haven!mimsy!chrisShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!aplcen!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.bugs.4bsd Subject: reno kernel `panic: missing dquot' when turning on accounting Message-ID: <26129@mimsy.umd.edu> Date: 22 Aug 90 18:17:44 GMT Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 92