Bug 43823

Summary: quotacheck hangs on filesystems with named pipes
Product: [Retired] Red Hat Linux Reporter: Anders Blomdell <anders.blomdell>
Component: quotaAssignee: Preston Brown <pbrown>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: jaanus
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: 2001-08-30 16:36: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-06-07 12:36:28 UTC
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 23:14:41 UTC
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 17:49:19 UTC
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 14:17:45 UTC
*** Bug 51881 has been marked as a duplicate of this bug. ***

Comment 4 Jaanus J6gisman 2001-08-27 07:47:16 UTC
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 07:37:14 UTC
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 16:36:34 UTC
fixing for an errata release.