dquot.c - addendum to previous fix

Chris Rankin (rankinc@bellsouth.net)
Sun, 15 Feb 1998 11:45:21 -0500


Hi,

Yesterday I posted a quick fix for a problem in linux/fs/dquot.c (if both User and Group quotas are enabled on a filesystem, and you disable one then you also cripple the other). It turns out that my fix falls a bit short since you still need to set

vfsmnt->mnt_sb->dq_op = (struct dquot_operations *)NULL;

I propose an extra loop at the end of the main for-loop in quota_off():

...
short iquota; /* new variable; could reuse cnt but don't want to confuse compiler's */
/* variable-lifetime analysis */
...
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
...
}

iquota = 0;
while (iquota < MAXQUOTAS) {
if (vfsmnt->mnt_quotas[iquota++])
return 0;
}
vfsmnt->mnt_sb->dq_op = (struct dquot_operations *)NULL;
return(0);
} /* end of quota_off() */

This way, the quota operations are only removed when the last quota is disabled.

Cheers,
Chris.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu