aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2013-06-30 00:42:51 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2013-06-30 00:42:51 +0000
commite2bc2ccec0167be27dc812532a502f1671b7fbba (patch)
tree3e4428347174d15d1dd82aa398069dc25497e17f /sys/fs
parent94addbe133edece05f64b6214008c201a85cb694 (diff)
downloadsrc-e2bc2ccec0167be27dc812532a502f1671b7fbba.tar.gz
src-e2bc2ccec0167be27dc812532a502f1671b7fbba.zip
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
Notes
Notes: svn path=/head/; revision=252397
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
index 54d1e89e39ee..9e6ce1a7bbba 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;
}