ext2fs: Use the complete random() range in i_gen.

i_gen is unsigned in ext2fs so we can handle the complete
32 bits.

MFC after:	1 week
This commit is contained in:
Pedro F. Giffuni 2013-06-30 00:42:51 +00:00
parent 94addbe133
commit e2bc2ccec0

View File

@ -979,7 +979,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
* already have one. This should only happen on old filesystems.
*/
if (ip->i_gen == 0) {
ip->i_gen = random() / 2 + 1;
ip->i_gen = random() + 1;
if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0)
ip->i_flag |= IN_MODIFIED;
}