Re: why is the size of a directory always 1024b ?

Alexander Viro (viro@math.psu.edu)
Thu, 24 Jun 1999 12:57:54 -0400 (EDT)


On Thu, 24 Jun 1999, MURALI N wrote:

> Please look at the listing below.
>
> "/"
>
> drwxr-xr-x 17 root root 1024 May 28 16:40 .
> drwxr-xr-x 17 root root 1024 May 28 16:40 ..
> drwxr-xr-x 2 root root 12288 May 4 21:35 lost+found
> drwxr-xr-x 5 root root 1024 May 5 12:12 mnt
> dr-xr-xr-x 33 root root 0 Jun 23 19:06 proc
>
> "lost+found"
>
> drwxr-xr-x 2 root root 12288 May 4 21:35 .
> drwxr-xr-x 17 root root 1024 May 28 16:40 ..
>
> If the present scheme allocates 13 * 1024 bytes for just "." and "..", I
> feel it is time to rethink the directory handling.

You *are* aware WTF lost+found is for, right? If fsck finds lost inodes it
means that fs is corrupted and the last thing you want to do here is to
extend a directory. lost+found is created by mkfs. Not by mkdir(2). Try to
create a directory with mkdir and look at the size. 12K are there not to
store '.' and '..' - they should be able to accomodate the links for lost
inodes. In situation when fs is damaged. Without touching bitmaps or
eating up new blocks.

Present scheme doesn't create lost+found. It is done by mkfs which has
perfectly valid reason to make it larger than 1 block.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/