From: Hans Reiser <reiser@namesys.com>
To: Michael Kerrisk <mtk-lists@jambit.com>
Cc: linux-kernel@vger.kernel.org, reiserfs-list@namesys.com,
mk <michael.kerrisk@gmx.net>, Vladimir Saveliev <vs@namesys.com>,
Chris Mason <mason@suse.com>
Subject: Re: Strange NOTAIL inheritance behaviour in Reiserfs 3.6
Date: Tue, 22 Jun 2004 14:30:28 -0700 [thread overview]
Message-ID: <40D8A4F4.6040102@namesys.com> (raw)
In-Reply-To: <041c01c45875$0368e340$c100a8c0@wakatipu>
vs and chris, please comment.
Hans
Michael Kerrisk wrote:
>Gidday,
>
>Problem summary:
>On a Reiserfs 3.6 file system, I create a directory with the NOTAIL
>attribute set and create 10000 1-byte files in that directory. lsattr(1)
>shows that the NOTAIL attribute is set on (i.e., inherited by) all of the
>files. However, the disk space consumption remains small (certainly not
>10000 blocks used). Only when I explicitly set the NOTAIL attribute on all
>the files does disk consumption rise to what I would expect. In other
>words, the files are inheriting the NOTAIL attribute form their parent
>directory, but this inheritance has no effect.
>
>Looking at the 2.6.6 (vanilla) kernel sources, AFAICS the code matches my
>observations (unpacking is only performed on an explicit ioctl() call).
>
>The question is why are things done like this? It certainly seems to be
>misleading, possibly buggy and undesirable behaviour.
>
>This behaviour observed on Reiserfs 3.6.13 (SUSE's 2.6.4 kernel on SUSE
>9.1).
>
>
>Detailed example follows:
>
>Create a file system, with a directory marked NOTAIL:
>
> # mkreiserfs -b 4096 /dev/hda12
> mkreiserfs 3.6.13 (2003 www.namesys.com)
> [...]
> Guessing about desired format.. Kernel 2.6.4-52-default is running.
> Format 3.6 with standard journal
> Count of blocks on the device: 158624
> Number of blocks consumed by mkreiserfs formatting process: 8216
> Blocksize: 4096
> Hash function used to sort names: "r5"
> Journal Size 8193 blocks (first block 18)
> Journal Max transaction length 1024
> inode generation number: 0
> UUID: 89f14047-2daf-4707-bce3-bbf9128ace2e
> ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
> ALL DATA WILL BE LOST ON '/dev/hda12'!
> Continue (y/n):y
> Initializing journal - 0%....20%....40%....60%....80%....100%
> Syncing..ok
> ReiserFS is successfully created on /dev/hda12.
>
> # mount -t reiserfs /dev/hda12 /testfs
> # mkdir /testfs/t
> # chattr +t /testfs/t
> # df /dev/hda12
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hda12 634472 32840 601632 6% /testfs
>
>The 'write_blocks' program creates 1000 files, each 1 byte long:
>
> # time ./write_blocks -s 1 -n 1 -m 10000 /te stfs/t/x
> real 0m1.142s
> user 0m0.056s
> sys 0m1.075s
> # df /dev/hda12
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hda12 634472 34080 600392 6% /testfs
>
>Above, we see a change in disc consumption of 1240 1-k blocks -- i.e., those
>10000 files are consuming way less than 10000 * 4096 bytes.
>
> # cd /testfs/t
>
>Show that there really are 10000 files, that they are 1 byte long, and that
>the NOTAIL attribute is set on on them:
>
> # ls | wc
> 10002 10002 80005
> # ls -l | head -8
> total 40234
> drwxr-xr-x 2 root root 240048 2004-06-22 17:59 .
> drwxr-xr-x 5 root root 104 2004-06-22 17:59 ..
> -rw-r--r-- 1 root root 1 2004-06-22 17:59 x000000
> -rw-r--r-- 1 root root 1 2004-06-22 17:59 x000001
> -rw-r--r-- 1 root root 1 2004-06-22 17:59 x000002
> -rw-r--r-- 1 root root 1 2004-06-22 17:59 x000003
> -rw-r--r-- 1 root root 1 2004-06-22 17:59 x000004
> # lsattr | head -5
> -----------t- ./x000000
> -----------t- ./x000001
> -----------t- ./x000002
> -----------t- ./x000003
> -----------t- ./x000004
>
>Now explicitly setting the NOTAIL attribute on all of the files causes the
>expected disk consumption:
>
> # time chattr +t *
>
> real 0m0.836s
> user 0m0.117s
> sys 0m0.711s
> # df /dev/hda12
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hda12 634472 74080 560392 12% /testfs
>
>74080-34080 ==> 40000 1-k bytes.
>
>Best regards,
>
>Michael Kerrisk
>
>
>
>
>
next prev parent reply other threads:[~2004-06-22 21:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-22 16:21 Strange NOTAIL inheritance behaviour in Reiserfs 3.6 Michael Kerrisk
2004-06-22 21:30 ` Hans Reiser [this message]
2004-06-23 11:11 ` Oleg Drokin
[not found] ` <005e01c459f7$6a8546d0$c100a8c0@wakatipu>
2004-06-24 15:58 ` Oleg Drokin
2004-06-24 16:11 ` Michael Kerrisk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40D8A4F4.6040102@namesys.com \
--to=reiser@namesys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=michael.kerrisk@gmx.net \
--cc=mtk-lists@jambit.com \
--cc=reiserfs-list@namesys.com \
--cc=vs@namesys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox