Description

repquota reports softlimits, hardlimits and ``used'' field
    incorrectly, namely those numbers get wrapped modulo 4Gbytes.

PR:	 bin/8164
Submitted by:	 Anton Berezin <tobez@plab.ku.dk>
This commit is contained in:
Julian Elischer 1999-11-01 04:46:09 +00:00
parent fdc79fd3fc
commit a8ae1d2ba8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52734

View File

@ -65,6 +65,17 @@ static const char rcsid[] =
#include <unistd.h>
#include <utmp.h>
/* Let's be paranoid about block size */
#if 10 > DEV_BSHIFT
#define dbtokb(db) \
((off_t)(db) >> (10-DEV_BSHIFT))
#elif 10 < DEV_BSHIFT
#define dbtokb(db) \
((off_t)(db) << (DEV_BSHIFT-10))
#else
#define dbtokb(db) (db)
#endif
#define max(a,b) ((a) >= (b) ? (a) : (b))
char *qfname = QUOTAFILENAME;
@ -238,9 +249,9 @@ repquota(fs, type, qfpathname)
fup->fu_dqblk.dqb_isoftlimit &&
fup->fu_dqblk.dqb_curinodes >=
fup->fu_dqblk.dqb_isoftlimit ? '+' : '-',
(u_long)(dbtob(fup->fu_dqblk.dqb_curblocks) / 1024),
(u_long)(dbtob(fup->fu_dqblk.dqb_bsoftlimit) / 1024),
(u_long)(dbtob(fup->fu_dqblk.dqb_bhardlimit) / 1024),
(u_long)(dbtokb(fup->fu_dqblk.dqb_curblocks)),
(u_long)(dbtokb(fup->fu_dqblk.dqb_bsoftlimit)),
(u_long)(dbtokb(fup->fu_dqblk.dqb_bhardlimit)),
fup->fu_dqblk.dqb_bsoftlimit &&
fup->fu_dqblk.dqb_curblocks >=
fup->fu_dqblk.dqb_bsoftlimit ?