RE: [patch] EXT2 inode.i_generation patch

Jeremy Fitzhardinge (jeremy@goop.org)
Tue, 16 Mar 1999 10:04:00 -0800 (PST)


On 16-Mar-99 G. Allen Morris III wrote:
> This patch modifies the ext2 filesystem so that it uses the new
> inode.i_generation field. No data structures where hurt in the
> making of this patch. Some names where changed to protect
> future maintainers.
>
> BUGS: There is a 1/(2^32) chance of not getting a new generation
> number on for a new inode.

Actually, I think by the birthday paradox there's a 50% chance of a collision
after generating 2^16 random numbers - but that assumes you're only ever
regenerating the generation number for one particular file.

get_random_bytes is pretty expensive, but there's some quicker versions used
for TCP sequence number generation which are probably worth looking at
(secure_tcp_sequence_number). UFS gets around it by assigning generation
numbers at mkfs time and incrementing (or using a cheap RNG) it from there.

J

-
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/