summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-06-30 00:42:51 +0000
committerpfg <pfg@FreeBSD.org>2013-06-30 00:42:51 +0000
commitb08e5aff180ceebe791c6bd7e308a9d13dda5687 (patch)
tree3e4428347174d15d1dd82aa398069dc25497e17f /sys/fs/ext2fs
parent2d4e4c277f35f77f752230dac9aea0f45124f37a (diff)
downloadFreeBSD-src-b08e5aff180ceebe791c6bd7e308a9d13dda5687.zip
FreeBSD-src-b08e5aff180ceebe791c6bd7e308a9d13dda5687.tar.gz
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
Diffstat (limited to 'sys/fs/ext2fs')
-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 54d1e89..9e6ce1a 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;
}
OpenPOWER on IntegriCloud