tech-kern archive

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

Re: Max. number of subdirectories dump



On Sun, Aug 18, 2013 at 03:08:21PM +0200, 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.

For defrag I'd have though you'd work from the inode table and treat
directories no different from files.
You would need to scan directories if you decide to renumber inodes,
but since they are indexed that may not gain much.

It might be worth rewriting directories in order to remove gaps and
possibly put subdirectories first (but you really want the most frequently
used entries first).

FYI A well known british internet payment scheme fell over when the 32768th
vendor account was added onto the live system!
(Solaris crash badly)

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index