RAND_MAX broken (was: Re: svn commit: r252484 - head/sys/ufs/ffs)

2013-07-02 Thread Bruce Evans
On Tue, 2 Jul 2013, Bruce Evans wrote: ... Also, random(9) is internally broken on 64-bit arches. It shouldn't exist. It is not random() at all, but just rand() with the clamp to RAND_MAX removed. Its linear congruential generator is suboptimal for 64 bits, and other parts of its algorithm ar

Re: svn commit: r252484 - head/sys/ufs/ffs

2013-07-01 Thread Bruce Evans
On Mon, 1 Jul 2013, Pedro F. Giffuni wrote: Log: Change i_gen in UFS to an unsigned type. Revert the simplification of the i_gen calculation. It is still a good idea to avoid zero values and for the case of old filesystems there is probably no advantage in using the complete 32 bits anyway

svn commit: r252484 - head/sys/ufs/ffs

2013-07-01 Thread Pedro F. Giffuni
Author: pfg Date: Mon Jul 1 21:43:40 2013 New Revision: 252484 URL: http://svnweb.freebsd.org/changeset/base/252484 Log: Change i_gen in UFS to an unsigned type. Revert the simplification of the i_gen calculation. It is still a good idea to avoid zero values and for the case of old fil