Bug 53863

Summary: quota-3.01pre9-0.7.1 broken on 2.4.2-2
Product: [Retired] Red Hat Linux Reporter: Anders Blomdell <anders.blomdell>
Component: quotaAssignee: Phil Copeland <copeland>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: mgb, nick
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-02 16:42:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anders Blomdell 2001-09-20 12:21:08 UTC
Description of Problem:

with quota-3.01pre9-0.7.1 many components doesn't work since the quota tools 
doesn't recognize that 2.4.2-2 uses newstyle quota files. The following 
patch is a fix to that problem.


--- quota-tools-rh/quotasys.c   Thu Sep 20 14:13:31 2001
+++ quota-tools-rh-work/quotasys.c      Thu Sep 20 13:33:32 2001
@@ -467,8 +467,30 @@
        if (quotactl(QCMD(Q_GETSTATS, 0), NULL, 0, (void *)&stats) < 0) {
                if (errno == ENOSYS || errno == ENOTSUP)        /* Quota not 
compiled? */
                        return QF_ERROR;
-               if (errno == EINVAL || errno == EFAULT || errno == EPERM)      
/* Old quota compiled? */
-                       return ret | (1 << QF_VFSOLD);
+               if (errno == EINVAL || errno == EFAULT || errno == EPERM) {    
/* Old quota compiled? */
+                 // RedHat 7.1 (2.4.2-2) newquota check 
+                 // Q_GETSTATS in it's old place, Q_GETQUOTA in the new 
place
+                 // (they haven't moved Q_GETSTATS to its new value)
+                 int err_stat = 0;
+                 int err_quota = 0;
+                 char tmp[1024];         /* Just temporary buffer */
+
+                 if (quotactl(QCMD(Q_V1_GETSTATS, 0), NULL, 0, (void *)&
stats)) {
+                   err_stat = errno;
+                 }
+                 if (quotactl(QCMD(Q_V1_GETQUOTA, 0), "", 0, tmp)) {
+                   err_quota = errno;
+                 }
+                 
+                 // On a RedHat 2.4.2-2        we expect 0, EINVAL
+                 // On a 2.4.x                 we expect 0, ENOENT
+                 // On a 2.4.x-ac              we wont get here
+                 if (err_stat == 0 && err_quota == EINVAL) {
+                   return ret | (1 << QF_VFSV0);       /* New format 
supported */
+                 } else {
+                   return ret | (1 << QF_VFSOLD);
+                 }
+               }
                die(4, _("Error while detecting kernel quota version: %s\
n"), strerror(errno));
        }
        /* We might do some more generic checks in future but this should be 
enough for now */

Comment 1 Danny Yee 2001-10-09 06:43:38 UTC
I can verify this problem (with a hand-build kernel 2.4.9): some of the quota
tools work if one specifies -F vfsv0 (for version 2 aquota files), but some
(e.g. and most importantly quotaon) don't support that option.

Can someone please put this patch into an RPM and release it as an update?
I don't want to have to build by own quota tools, and surely a totally
non-functional quota package is a bad enough bug to warrant an update!


Comment 2 Need Real Name 2001-10-09 18:59:37 UTC
Patched rpms are here

ftp://operator.burst.net/sysup/7.1/quota/

Comment 3 Preston Brown 2001-11-06 17:26:30 UTC
*** Bug 54475 has been marked as a duplicate of this bug. ***

Comment 4 Phil Copeland 2002-08-02 16:42:34 UTC
Could you have a shot with using the quota-3.06-2 package thats in rawhide
please (I don't have a <7.3 system to hand to verify this) and tell me if this
problem still persists

ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/quota-3.06-2.src.rpm
ftp://ftp.redhat.com/pub/redhat/linux/rawhide/i386/RedHat/RPMS/quota-3.06-2.i386.rpm

Thanks

Phil
=--=

Comment 5 Phil Copeland 2002-08-05 20:33:12 UTC
No activity

Closing