Bugreport: Disk and Quotaoverrun Bug

Andreas Abach Abach at LKT.Uni-Erlangen.de
Tue Dec 7 14:26:43 GMT 1999


Bugreport: Disk and Quotaoverrun Bug

Online version with screenshots is avaliable at
www.lkt.uni-erlangen.de/samba-bug/

System:
Debian Linux 2.1 Slink stable, Kernel 2.2.13, 2.3.28
Slackware 7.0, Kernel 2.2.13
Slackware 3.0 with 95 % manual updates, Kernel 2.2.13, libc.so.5.4.46,

Samba 2.0.5a-5 
Samba 2.0.6
(Samba 1.9.16p11 )
Windows NT 4.0 WKS German SP 5

Diskoverrun bug:

Short description:
When a file that is larger than the available free space is copied to a
samba share, the copy operation seems to be successful, and the file
will be reported with its original filesize, but the copy of the file
on the network share will be damaged.

Quotaoverrun bug:
The same situation as described in the diskoverrun bug will happen,
when user exceeds their userquota.

The consequence of the two bugs just described is that inexperienced
(read: "ignorant") users will ignore the error messages and thusly
collect damaged files on their shares. They will not understand why
their files are "suddenly" damaged.
I first discovered the problem when I used the "quota" facility. But
the problem also occurs when quota support isn't compiled into Samba
and a disk is running out of space. With older Samba versions the
problem can't be observed.

Diskoverrun bug:
A single partition is used as a share:
sda15 Logical Linux ext2 125.51 MB
mkfs.ext2 was used with default values to create the filesystem.

fileserver:/mnt/tmp# ls -la
total 14
drwxr-xrwx   3 root     root         1024 Nov 16 10:45 .
drwxr-xr-x   4 root     root         1024 Nov 15 09:43 ..
drwxr-xr-x   2 root     root        12288 Nov 15 09:43 lost+found
fileserver:/mnt/tmp# df
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/sda15            124407      13   117970      0%   /mnt/tmp

A testfile is generated and moved to the NT client:
dd if=/dev/mem of=200MB.test.file bs=1024k count=200

fileserver:/mnt/raid# md5sum 200MB.test.file 
effb1c42c8b7ddf464468a92366acc05  200MB.test.file

Filesize is reported as 209715.200 Bytes on the NT System

The share is mounted to a driver letter on the NT client

The Test file is copied to the share using Windows Explorer.
An error Message pops up.

Explorer and the Linux shell show the following information:


fileserver:/mnt/tmp# ls -la
total 117991
drwxr-xrwx   3 root     root         1024 Nov 16 11:21 .
drwxr-xr-x   4 root     root         1024 Nov 15 09:43 ..
-rwxr--r--   1 abach    abach    209715200 Nov 16 10:16 200MB.test.file
drwxr-xr-x   2 root     root        12288 Nov 15 09:43 lost+found
fileserver:/mnt/tmp# du
12      ./lost+found
117990  .
fileserver:/mnt/tmp# df
Filesystem         1024-blocks  Used Available Capacity Mounted on
//dev/sda15            124407  117990        0    100%   /mnt/tmp
fileserver:/mnt/tmp# md5sum 200MB.test.file 
a1209318809575c8147f5e04a2acebd3  200MB.test.file

Qutooverrun Bug:
Userquota are set up as follows:
Edquota:
Quotas for user abach:
/dev/sdb5: blocks in use: 4, limits (soft = 0, hard = 20000) 
        inodes in use: 4, limits (soft = 0, hard = 20000)

The share is mounted to a driver letter on the NT client
 
A test file is generated, moved to the NT client, and copied to the
samba share one time:

fileserver:/home/abach# dd if=/dev/mem of=15MB.test.file bs=1024k
count=15
15+0 records in
15+0 records out
fileserver:/home/abach# ls -la
total 15426
drwxr-sr-x   2 abach    abach        1024 Nov 16 14:13 .
drwxrwsr-x   6 root     staff        1024 Nov 12 19:10 ..
-rw-------   1 abach    abach          28 Nov 10 16:59 .bash_history
-rw-r--r--   1 abach    abach          68 Nov 10 13:09 .bash_profile
-rw-r--r--   1 abach    abach          55 Nov 10 13:09 .bashrc
-rw-r--r--   1 abach    abach    15728640 Nov 16 14:13 15MB.test.file
fileserver:/home/abach# md5sum 15MB.test.file 
3d25d840cd00e973b27b6c34836f2981  15MB.test.file

Now a second copy of the testfile is copied to the share:

fileserver:/home/abach# ls -la
total 20001
drwxr-sr-x   2 abach    abach        1024 Nov 16 14:22 .
drwxrwsr-x   6 root     staff        1024 Nov 12 19:10 ..
-rw-------   1 abach    abach          28 Nov 10 16:59 .bash_history
-rw-r--r--   1 abach    abach          68 Nov 10 13:09 .bash_profile
-rw-r--r--   1 abach    abach          55 Nov 10 13:09 .bashrc
-rw-r--r--   1 abach    abach    15728640 Nov 16 14:13 15MB.test.file
-rwx------   1 abach    abach    15728640 Nov 16 14:13
V2_15MB.test.file
fileserver:/home/abach# md5sum V2_15MB.test.file 
5fc1bfa8980694965d34c70df16dba8d  V2_15MB.test.file
fileserver:/home/abach# du
20000.


Compare with an NT-System:

When an 700 MB file is copied to another local disk within the same
NT-system (which has free disk space of 400 MB), an error message
occurs, but no file will be left.



Compare with an old Samba-Version

On Samba 1.9.16p11 an error message occurs on the Windows client when a
file is copied that is bigger than the drive space left on the Linux
System, and no file will be left on the disk.

-- 
Dipl.-Ing. Andreas Abach *KT Lehrstuhl fuer Kunststofftechnik Uni Erlangen
 Tel. +49-9131-85-297-06 * Fax.: -09 * email: Abach at LKT.Uni-Erlangen.de
Am Weichselgarten 9 * D-91058 Erlangen * url: http://www.lkt.uni-erlangen.de
PGPID 0x5672B1F8 F-Print FD50 85C0 7580 5467 65E7 3BE8 58BC 65F4 5672 B1F8




More information about the samba-technical mailing list