On Sun, Jun 25, 2017 at 8:34 PM, Ted Unangst <t...@tedunangst.com> wrote:
>> This patch always assigns a random non-zero positive integer in [1,
>> INT_MAX] range, not equal to the previous generation number.
>
> will this cause problems if a number repeats? we've seen problems with that
> before, where you get a sequence like 4, 7, 4 and then bad things happen.

Ah, didn't think about this.

>From the overengineering department: to create completely distinct
pseudorandom generation numbers keep a key ("seed") in inode and
encrypt counter with 32-bit-block cipher. (j/k)

>From the common sense department: keep the current version, which does
simple increment, just make sure it won't overflow.

--
Dmitry Chestnykh
https://www.codingrobots.com

Reply via email to