Bug 43823 - quotacheck hangs on filesystems with named pipes
quotacheck hangs on filesystems with named pipes
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: quota (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
David Lawrence
:
: 51881 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-07 08:36 EDT by Anders Blomdell
Modified: 2007-04-18 12:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-30 12:36:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Anders Blomdell 2001-06-07 08:36:28 EDT
Description of Problem:


How Reproducible:


Steps to Reproduce:
1. run quotacheck on a filesystem with named pipes (mknod -p) on them

A strightforward patch is this one (only open dir's and regular files for 
ioctl, since other files won't behave as expected):

diff -u quota-3.00.orig/quotacheck.c quota-3.00/quotacheck.c
--- quota-3.00.orig/quotacheck.c        Thu Jun  7 14:29:38 2001
+++ quota-3.00/quotacheck.c     Thu Jun  7 14:28:00 2001
@@ -260,19 +260,22 @@
   int fd;
   loff_t size;
 
-  if (S_ISLNK(st->st_mode))    /* There's no way to do ioctl() on links... 
*/
-    return st->st_blocks << 9;
-  if ((fd = open(fname, O_RDONLY)) == -1)
-         return 0; /* quota file will be created later */
-  if (ioctl(fd, FIOQSIZE, &size) == -1) {
-    size = st->st_blocks << 9;
-    if (!ioctl_fail_warn) {
-      ioctl_fail_warn = 1;
-      fputs("Cannot get exact used space... Results might be inaccurate.\
n", stderr);
+  if (S_ISDIR(st->st_mode) || S_ISREG(st->st_mode)) {
+    if ((fd = open(fname, O_RDONLY)) == -1)
+      return 0; /* quota file will be created later */
+    if (ioctl(fd, FIOQSIZE, &size) == -1) {
+      size = st->st_blocks << 9;
+      if (!ioctl_fail_warn) {
+       ioctl_fail_warn = 1;
+       fputs("Cannot get exact used space... Results might be inaccurate.\
n", stderr);
+      }
     }
+    close(fd);
+    return size;
+  } else {
+    /* There's no way to do ioctl() on links, fifos, ... */
+    return st->st_blocks << 9;
   }
-  close(fd);
-  return size;
 }
 
 /*
Comment 1 Jaanus J6gisman 2001-06-10 19:14:41 EDT
I have here the same problem.
When running quotacheck, it will hang when it comes to directory .screen
which contains like:
prw-------    1 user     users           0 Sep 29  2000 11243.pts-1.mail
prwx------    1 user     users           0 Sep 29  2000 15290.pts-5.mail
prw-------    1 user     users           0 Feb  8 16:07 16721.pts-3.mail

after removing all these files, quotacheck was completed successfully.
Comment 2 Preston Brown 2001-07-20 13:49:19 EDT
Would you like to beta test some new quota RPMs?  They are available at:

http://people.redhat.com/pbrown/quota-3.01pre8-1.i386.rpm

I would appreciate your feedback on this package.
Comment 3 Preston Brown 2001-08-24 10:17:45 EDT
*** Bug 51881 has been marked as a duplicate of this bug. ***
Comment 4 Jaanus J6gisman 2001-08-27 03:47:16 EDT
tried to install this beta rpm:
[root@tolmu /root]# rpm -Uvh quota-3.01pre8-1.i386.rpm 
Preparing...                ########################################### [100%]
file /usr/include/rpcsvc/rquota.h from install of quota-3.01pre8-1 conflicts 
with file from package glibc-devel-2.2.2-10
file /usr/include/rpcsvc/rquota.x from install of quota-3.01pre8-1 conflicts 
with file from package glibc-devel-2.2.2-10

then forced install:
[root@tolmu /root]# rpm -Uvh quota-3.01pre8-1.i386.rpm --force 
Preparing...                ########################################### [100%]
   1:quota                  ########################################### [100%]

and then i ran quotacheck:
[root@tolmu /]# /sbin/quotacheck -vugm /dev/hda4
quotacheck: Detected quota format vfsv0
quotacheck: Going to check user quota file of /home
quotacheck: Checking quotafile info...
quotacheck: Headers of file /home/aquota.user checked. Going to load data...
quotacheck: Not found any corrupted blocks. Congratulations.
quotacheck: Scanning /dev/hda4 [/home] done
quotacheck: Checked 8371 directories and 170588 files
quotacheck: Dumping gathered data for users.
quotacheck: Data dumped.
Renaming old quotafile to /home/aquota.user~
quotacheck: Renaming new quotafile

so it was completed successfully.

i remember that with previous version of quotacheck i was able to see what 
files and directories it was currently scanning.
But with this version this was not possible.. or.. any hint?
Comment 5 Jaanus J6gisman 2001-08-28 03:37:14 EDT
this new beta rpm has this  "feature" that 
if quota is off (quotaoff -guav) and if i use "quota" command i get:

[jaanus@tolmu jaanus]$ quota
quota: Can't open quotafile /home/aquota.user: Permission denied
quota: Can't open quotafile /var/aquota.user: Permission denied
Disk quotas for user jaanus (uid 500): none

but it should be something like:
[jaanus@tolmu jaanus]$ quota
Disk quotas for user jaanus(500):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/hda4: Quotas disabled
      /dev/hda3: Quotas disabled


if i enable quotas (quotaon -guav) then it's all ok:
Disk quotas for user jaanus (uid 500):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/hda3       8   10000   15000               1      10      15


Comment 6 Preston Brown 2001-08-30 12:36:34 EDT
fixing for an errata release.

Note You need to log in before you can comment on or make changes to this bug.