On Tue, May 26, 2020 at 11:58:39AM +0200, Otto Moerbeek wrote:

> Hi,
> 
> In theory ffs code support a maximum of UINT_MAX inodes, but in
> practice, due to integer overflows in the current code, the limit is
> INT_MAX inodes.
> 
> This fixes that, and allows me to create and use filesystems with more
> than INT_MAX inodes. This is partly from FreeBSD code.
> 
> Main change is in fs.h, modifying a few fields to unsigned, most
> notably fs_ipg (inodes per cylinder group) and fs_ncg (number of
> cylinder groups). In various places fs_ipg * fs_ncg is computed, so
> both should be unsigned. I also made sure cg indexes are unsigned and
> ino_t is used for inode numbers.
> 
> Tested on a 30TB partition with various parameters (notably -f x -b y
> and -i z combinations).
> 
> Please test and/or review,

Apart from the noting the strange Subject: I also like to mention one
change in the way cylinder groups are scanned. The current code scans
forward and backward, which causes an uneven distribution of full cgs
(the upper end of the cgs will get full first). Fix that by always
scanning forward, wrapping to cg 0 if needed.

        -Otto

Reply via email to