panic: dqflush: stray dquot on FreeBSD 5.4 - quota problem
My server crashed 2 nights at a row (saturday, sunday) a few weeks ago at around 00:00. Couldn't find the cause of the problem then...and it didn't occur again...until yesterday. Saturday/sunday morning at 00:00.The console says: "panic: dqflush: stray dquot".
Nothing in any of the logs.
Googling for this error didn't give me an answer...just found that it happened to a few other people as well.
The server is a shared server running FreeBSD 5.4 and DirectAdmin Control Panel.
It has 326 users and quota enabled.
It's been running for about 6 months before this without a problem...we haven't done any major updates...
Kernel compiled with:
options QUOTA
In /etc/crontab:
5 0 * * * root /usr/sbin/quotaoff -a; /sbin/quotacheck -aug; /usr/sbin/quotaon -a;
My guess it that quotaoff, quotacheck or quotaon causes the crash since the error message "panic: dqflush: stray dquot" can be found in ufs_quota.c:
/*
* Flush all entries from the cache for a particular vnode.
*/
void
dqflush(vp)
struct vnode *vp;
{
struct dquot *dq, *nextdq;
struct dqhash *dqh;
/*
* Move all dquot's that used to refer to this quota
* file off their hash chains (they will eventually
* fall off the head of the free list and be re-used).
*/
for (dqh = &dqhashtbl[dqhash]; dqh >= dqhashtbl; dqh--) {
for (dq = dqh->lh_first; dq; dq = nextdq) {
nextdq = dq->dq_hash.le_next;
if (dq->dq_ump->um_quotas[dq->dq_type] != vp)
continue;
if (dq->dq_cnt)
panic("dqflush: stray dquot");
LIST_REMOVE(dq, dq_hash);
dq->dq_ump = (struct ufsmount *)0;
}
}
}
* Flush all entries from the cache for a particular vnode.
*/
void
dqflush(vp)
struct vnode *vp;
{
struct dquot *dq, *nextdq;
struct dqhash *dqh;
/*
* Move all dquot's that used to refer to this quota
* file off their hash chains (they will eventually
* fall off the head of the free list and be re-used).
*/
for (dqh = &dqhashtbl[dqhash]; dqh >= dqhashtbl; dqh--) {
for (dq = dqh->lh_first; dq; dq = nextdq) {
nextdq = dq->dq_hash.le_next;
if (dq->dq_ump->um_quotas[dq->dq_type] != vp)
continue;
if (dq->dq_cnt)
panic("dqflush: stray dquot");
LIST_REMOVE(dq, dq_hash);
dq->dq_ump = (struct ufsmount *)0;
}
}
}
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad4s1a 150977582 28824108 110075268 21% /
fstab:
# Device Mountpoint FStype Options Dump Pass#
/dev/ad4s1a / ufs rw,userquota,groupquota 1 1
I'm not quite sure how I would go about finding the cause of the problem...I would be very happy with some pointers/feedback from you guys on what I could try.
Any ideas?