reiserfs tails and disk space
Hi.
I've been running a few tests with reiserfs and tails, and have been unable to create a setup where the use (or lack) of tails results in a significant difference in the amount of disk space used.
Here's what I've done:
1. Create a fresh 1GB filesystem (in a file on loopback), using reiserfs with no options.
2. Mount the filesystem with either no options, "notail", "tails=off", "tails=on", or "tails=small".
3. Unpack a sources tarball onto the filesystem, consisting of two fully compiled versions of the linux kernel. The tarball contains 47996 files and 3321 directories totalling about 660MB of space.
4. Measure the free disk space using df.
5. Use dd to fill up the free disk space and count how many 1kB blocks it could write.
In all of the tests, the result was within 12kB of each other. In fact, the tests with "notail" or "tails=off" options had more usable disk space than when using tails.
Results:
Options 1K-blocks Used Available
default 1023964 645988 377976 notail 1023964 645988 377976 tails=off 1023964 645996 377968 tails=on 1023964 646000 377964 tails=small 1023964 645996 377968
default 377600+0 records out notail 377600+0 records out tails=off 377592+0 records out tails=on 377588+0 records out tails=small 377592+0 records out
I've put the log files and scripts up for review at
http://untroubled.org/reiserfsdf/
I'm using Gentoo Linux, kernel 2.6.14-gentoo-r5
Am I missing something, is this an expected result, or is something broken?
Thanks.
Signature · 2 lines
Bruce Guenter <[email protected]> http://untroubled.org/ OpenPGP key: 699980E8 / D0B7 C8DD 365D A395 29DA 2E2A E96F B2DC 6999 80E8
The result is not expected, Vitaly please look into it.
Hans
Quoted 52 lines · Bruce Guenter
Hi.
I've been running a few tests with reiserfs and tails, and have been unable to create a setup where the use (or lack) of tails results in a significant difference in the amount of disk space used.
Here's what I've done:
1. Create a fresh 1GB filesystem (in a file on loopback), using reiserfs with no options.
2. Mount the filesystem with either no options, "notail", "tails=off", "tails=on", or "tails=small".
3. Unpack a sources tarball onto the filesystem, consisting of two fully compiled versions of the linux kernel. The tarball contains 47996 files and 3321 directories totalling about 660MB of space.
4. Measure the free disk space using df.
5. Use dd to fill up the free disk space and count how many 1kB blocks it could write.
In all of the tests, the result was within 12kB of each other. In fact, the tests with "notail" or "tails=off" options had more usable disk space than when using tails.
Results:
Options 1K-blocks Used Available
default 1023964 645988 377976 notail 1023964 645988 377976 tails=off 1023964 645996 377968 tails=on 1023964 646000 377964 tails=small 1023964 645996 377968default 377600+0 records out notail 377600+0 records out tails=off 377592+0 records out tails=on 377588+0 records out tails=small 377592+0 records outI've put the log files and scripts up for review at
http://untroubled.org/reiserfsdf/
I'm using Gentoo Linux, kernel 2.6.14-gentoo-r5Am I missing something, is this an expected result, or is something broken?
Thanks.
Quoted 11 lines · Hans Reiser
The result is not expected, Vitaly please look into it.
Hans
Quoted 5 lines · Bruce Guenter
Hi.
I've been running a few tests with reiserfs and tails, and have been unable to create a setup where the use (or lack) of tails results in a significant difference in the amount of disk space used.
thank you for the report, the attached patch should fix the broken mount options. please try it.
Quoted 49 lines
Quoted 46 lines
Here's what I've done:
1. Create a fresh 1GB filesystem (in a file on loopback), using reiserfs with no options.
2. Mount the filesystem with either no options, "notail", "tails=off", "tails=on", or "tails=small".
3. Unpack a sources tarball onto the filesystem, consisting of two fully compiled versions of the linux kernel. The tarball contains 47996 files and 3321 directories totalling about 660MB of space.
4. Measure the free disk space using df.
5. Use dd to fill up the free disk space and count how many 1kB blocks it could write.
In all of the tests, the result was within 12kB of each other. In fact, the tests with "notail" or "tails=off" options had more usable disk space than when using tails.
Results:
Options 1K-blocks Used Available
default 1023964 645988 377976 notail 1023964 645988 377976 tails=off 1023964 645996 377968 tails=on 1023964 646000 377964 tails=small 1023964 645996 377968default 377600+0 records out notail 377600+0 records out tails=off 377592+0 records out tails=on 377588+0 records out tails=small 377592+0 records outI've put the log files and scripts up for review at
http://untroubled.org/reiserfsdf/
I'm using Gentoo Linux, kernel 2.6.14-gentoo-r5Am I missing something, is this an expected result, or is something broken?
Thanks.
Signature · 1 line
Vitaly
fs/reiserfs/super.c +1 -1
@@ -1131,7 +1131,7 @@REISERFS_SB (s)->s_mount_opt &= ~(1 <<REISERFS_ATTRS ); } }else if (le32_to_cpu (rs->s_flags) & reiserfs_attrs_cleared) { -REISERFS_SB (s)->s_mount_opt |=REISERFS_ATTRS ; +REISERFS_SB (s)->s_mount_opt |= (1 <<REISERFS_ATTRS ); } }
Quoted 2 lines · Vitaly Fertman
thank you for the report, the attached patch should fix the broken mount options. please try it.
It does indeed fix the problem. What other mount options would have been affected by this problem? In what version of the kernel was this problem introduced?
Thanks.
Signature · 2 lines
Bruce Guenter <[email protected]> http://untroubled.org/ OpenPGP key: 699980E8 / D0B7 C8DD 365D A395 29DA 2E2A E96F B2DC 6999 80E8
Quoted 6 lines · Bruce Guenter
Quoted 2 lines · Vitaly Fertman
thank you for the report, the attached patch should fix the broken mount options. please try it.
It does indeed fix the problem. What other mount options would have been affected by this problem?
it does not seem to brake anything else.
Quoted 2 lines
In what version of the kernel was this
problem introduced?
2.6.13.
Signature · 1 line
Vitaly
Quoted 11 lines · Vitaly Fertman
Quoted 7 lines · Bruce Guenter
Quoted 2 lines · Vitaly Fertman
thank you for the report, the attached patch should fix the broken mount options. please try it.
It does indeed fix the problem. What other mount options would have been affected by this problem?
Quoted 9 lines
it does not seem to brake anything else.
Quoted 2 lines
In what version of the kernel was this
problem introduced?2.6.13.
This patch have been pushed into 2.6.16-rc1-mm2, and now I have some permissions problems : I'm not able to update some files or directories althought the permissions seems OK. Not all files are impacted.
Reverting someone-broke-reiserfs-v3-mount-options-this-fixes-it.patch fixes my permissions problems.
I have to say this filesystem have been badly hit by the 2.6.16-rc1-mm1 reiserfs' bugs. I had to issue a "fsck.reiserfs --rebuild-tree" to get back about 1 Gb of files in lost+found (reiserfsck 3.6.19).
Here are some logs taken with an unpatched 2.6.16-rc1-mm2 kernel :
Script started on Sat Jan 21 17:54:22 2006
[ this is root user ]
sh-3.00# cd /home/gnutella/
sh-3.00# df -h .
Filesystem Size Used Avail Use% Mounted on/dev/mapper/vglinux1-lvhome
5.0G 4.8G 291M 95% /home
sh-3.00# mount
[...]/dev/mapper/vglinux1-lvhome on /home type reiserfs (rw) [...]
sh-3.00# ls -ld .
drwx--x--x 18 gnutella gnutella 768 Jan 21 16:35 . sh-3.00# ls -l
total 16
drwxr-xr-x 3 gnutella gnutella 72 Dec 24 2002 News lrwxrwxrwx 1 gnutella gnutella 21 Jan 20 00:19 azureus -> /home/laurent/azureus -rw-r--r-- 1 root root 121 Jan 21 16:35 essai -rw-r--r-- 1 root root 121 Jan 21 15:44 essai2 -rw-r--r-- 1 root root 121 Jan 21 16:24 essai3 -rw-r--r-- 1 root root 0 Jan 21 16:35 essai4 drwxr-xr-x 5 gnutella gnutella 120 Jan 20 00:11 klibido -rw------- 1 gnutella gnutella 377 Jan 20 00:22 nohup.out drwx------ 7 gnutella gnutella 320 Jan 21 04:08 tmp
sh-3.00# touch essai5
touch: cannot touch `essai5': Permission denied sh-3.00# > eesai5
sh: eesai5: Permission denied
sh-3.00# rm essai
rm: remove write-protected regular file `essai'? y
rm: cannot remove `essai': Permission denied
sh-3.00# strace touch essaiexecve("/bin/touch", ["touch", "essai"], [/* 13 vars */]) = 0 uname({sys="Linux", node="antares.localdomain", ...}) = 0
brk(0) = 0x8051000
[...]open("essai", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)utime("essai", NULL) = -1 EACCES (Permission denied)write(2, "touch: ", 7touch: ) = 7
write(2, "cannot touch essai\'", 20cannot touch essai') = 20write(2, ": Permission denied", 19: Permission denied) = 19
write(2, "\n", 1
) = 1exit_group(1) = ?
Process 1699 detached
sh-3.00# ls -l
total 16
drwxr-xr-x 3 gnutella gnutella 72 Dec 24 2002 News lrwxrwxrwx 1 gnutella gnutella 21 Jan 20 00:19 azureus -> /home/laurent/azureus -rw-r--r-- 1 root root 121 Jan 21 16:35 essai -rw-r--r-- 1 root root 121 Jan 21 15:44 essai2 -rw-r--r-- 1 root root 121 Jan 21 16:24 essai3 -rw-r--r-- 1 root root 0 Jan 21 16:35 essai4 drwxr-xr-x 5 gnutella gnutella 120 Jan 20 00:11 klibido -rw------- 1 gnutella gnutella 377 Jan 20 00:22 nohup.out drwx------ 7 gnutella gnutella 320 Jan 21 04:08 tmp
sh-3.00# strace vi essai 2>/tmp/trace
[...]
sh-3.00# grep essai /tmp/essaiexecve("/bin/vi", ["vi", "essai"], [/* 13 vars */]) = 0 stat64("essai", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0 stat64("/home/gnutella/essai", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0stat64("essai", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0 stat64("essai", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0
access("essai", W_OK) = -1 EACCES (Permission denied)
open("essai", O_RDONLY|O_LARGEFILE) = 3
open("essai", O_RDONLY|O_LARGEFILE) = 3stat64("essai", {st_mode=S_IFREG|0644, st_size=121, ...}) = 0 sh-3.00#
Script done on Sat Jan 21 18:24:23 2006
~~
laurent