tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Max. number of subdirectories dump



On 2013-08-18 15:08, Manuel Wiesinger wrote:
Hello,

I am working on a defrag tool for UFS2/FFSv2 as Google Summer of Code
Project.

The size of a directory offset is of type int32_t (see
src/sys/ufs/ufs/dir.h), which is a signed integer. So the maximum size
can be (2^31)-1.

When testing, the maximum number of subdirectories was 32767, which is
(2^15)-1, when trying to add a 32767th directory, I got the error
message: "Too many links".
When my tools reads only the single indirect blocks, it get all 32767
subdirectories.

In some Oracle documentation[1] of UFS2 says, this is the defined
maximum of subdirectories. But this is another implementation.

When studying the sourcecode of dump(8), I found out that in traverse.c
there is a function dirindir(), which iterates recursively through all
indirect blocks of directories, even through triple indirect blocks.

My question is:
Is the number of subdirectories really limited by (2^15)-1?

As Joerg said, the link count is the limitation here.

If, yes why does dump iterate the indirect blocks, when looking for
subdirectories?

Not sure I understand the question. Are you suggesting that you don't need to scan through all the contents of a directory to find the subdirectories?

        Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index