From e2bc2ccec0167be27dc812532a502f1671b7fbba Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sun, 30 Jun 2013 00:42:51 +0000 Subject: [PATCH] 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 --- sys/fs/ext2fs/ext2_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index 54d1e89e39e..9e6ce1a7bbb 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -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; }