Bug 34059 - user can write a file exceed the disk space the quota distrute to him
user can write a file exceed the disk space the quota distrute to him
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: quota (Show other bugs)
7.1
i386 Linux
high Severity high
: ---
: ---
Assigned To: Preston Brown
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-30 08:32 EST by Bill Huang
Modified: 2005-10-31 17:00 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-06 04:20:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test program:filetest.c (807 bytes, patch)
2001-03-30 08:33 EST, Bill Huang
no flags Details | Diff

  None (edit)
Description Bill Huang 2001-03-30 08:32:09 EST
test with qa0327.0 tree 

quota given user bill 150k space,it is correct that it is failed to write a
200k size file.
however when the function ftruncate() is used to fill 200k size file,it
returned true and the file was created.

the source of test program is attached.

not too sure it is a quota issue or glibc issue...


[root@dolphins /root]# cat /etc/fstab
LABEL=/                 /                       ext2    defaults        1 1
LABEL=/bhuang            /bhuang                 ext2   
defaults,usrquota   1 2LABEL=/boot             /boot                  
ext2    defaults        1 2
/dev/fd0                /mnt/floppy             auto    noauto,owner    0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
/dev/hda6               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              iso9660
noauto,owner,kudzu,ro 0
[root@dolphins /root]# mount /bhuang
[root@dolphins /root]# tocuh /bhuang/quota.user
bash: tocuh: command not found
[root@dolphins /root]# touch /bhuang/quota.user
[root@dolphins /root]# convertquota /bhuang
[root@dolphins /root]# mount -o remount /bhuang
[root@dolphins /root]# quotacheck -a
[root@dolphins /root]# quotaon -a
[root@dolphins /root]# edquota bill
[root@dolphins /root]# repquota bill
[root@dolphins /root]# edquota bill
[root@dolphins /root]#

[root@station23 bhuang]# cat edquota-bill 
Quotas for user bill:
  Filesystem                  Blocks       Soft       Hard    Inodes     
Soft      Hard
/dev/hda7                        200        100        150        
1         0         0
~

[bill@dolphins bill]$ ./a.out 
ide0(3,7): warning, user block quota exceeded.
                                              ide0(3,7): write failed, user
block limit reached.
                write error!!
ftruncate result = 0
[bill@dolphins bill]$ 

the result of test program:

ot@dolphins /root]# ll /bhuang
-rw-------    1 root     root          200  37n 30 21:28 1
-rw-------    1 root     root         7168  37n 30 21:34 aquota.user
-rw-------    1 root     root         2048  37n 30 21:30 aquota.user~
drwxr-xr-x    2 root     root        16384  37n 30 19:17 lost+found
-rw-r--r--    1 root     root            0  37n 30 21:30 quota.user
-rw-r--r--    1 bill     bill       204800  37n 30 21:33 testfile
[root@dolphins /root]#
Comment 1 Bill Huang 2001-03-30 08:33:30 EST
Created attachment 14223 [details]
test program:filetest.c
Comment 2 Jakub Jelinek 2001-04-03 18:26:24 EDT
What ls -l sais is completely uninteresting here, try du -b
instead. Quota is about used blocks on the disk, with holes you can
have several gigabytes large file which occupies only a few kilobytes
on the disk e.g.
Comment 3 Bill Huang 2001-04-06 04:15:26 EDT
result of du -b testfile:
151552  testfile

The behaviour of quota is correct?
and ftruncate() is also correct?
Comment 4 Jakub Jelinek 2001-04-06 04:20:25 EDT
Yes, the behaviour is correct. The file occupies less than 150K on the disk.

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