Subject: | Problems on AIX |
Date: | Wed, 30 Jun 2010 17:46:37 +0200 |
To: | bug-Quota [...] rt.cpan.org |
From: | "Heinrich Mislik" <Heinrich.Mislik [...] univie.ac.at> |
Hi,
two issues:
First:
Quota-1.6.4 will not compile on AIX with IBMs C-compiler. This
compiler allows declartions only on beginning of blocks.
Second:
Setting of quotas fails sometimes with EOVERFLOW. The compiler does
not initialize the struct dqblk. When dqblk.QS_FCUR or dqblk.QS_BCUR
contain some garbage (negative values) EOVERFLOW occurs.
Here is a Patch:
*** Quota.xs.orig Sun Dec 20 14:56:43 2009
--- Quota.xs Wed Jun 30 17:33:12 2010
***************
*** 190,195 ****
--- 190,196 ----
dqp->QS_BCUR = gq_rslt.GQR_RQUOTA.rq_curblocks;
#else /* not buggy */
if (gq_rslt.GQR_RQUOTA.rq_bsize >= DEV_QBSIZE) {
+ int qb_fac = gq_rslt.GQR_RQUOTA.rq_bsize / DEV_QBSIZE;
/* assign first, multiply later:
** so that mult works with the possibly larger type in dqp
*/
dqp->QS_BHARD = gq_rslt.GQR_RQUOTA.rq_bhardlimit;
***************
*** 198,204 ****
/* we rely on the fact that block sizes are always powers of
2 */
/* so the conversion factor will never be a fraction */
- int qb_fac = gq_rslt.GQR_RQUOTA.rq_bsize / DEV_QBSIZE;
dqp->QS_BHARD *= qb_fac;
dqp->QS_BSOFT *= qb_fac;
dqp->QS_BCUR *= qb_fac;
--- 199,204 ----
***************
*** 568,573 ****
--- 568,577 ----
dqblk.QS_FSOFT = fs;
dqblk.QS_FHARD = fh;
dqblk.QS_FTIME = timelimflag;
+ #ifdef AIX
+ dqblk.QS_BCUR = 0;
+ dqblk.QS_FCUR = 0;
+ #endif /* AIX */
#ifdef USE_IOCTL
if((fd = open(dev, O_RDONLY)) != -1) {
RETVAL = (ioctl(fd, Q_QUOTACTL, &qp) != 0);
This may also apply to the HAVE_JFS2 part (couldn't test)
Cheers
Heinrich
--
Heinrich Mislik
Zentraler Informatikdienst der Universitaet Wien
A-1010 Wien, Universitaetsstrasse 7
Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140