svn commit: r252397 - head/sys/fs/ext2fs
Pedro F. Giffuni
pfg at FreeBSD.org
Sun Jun 30 00:42:51 UTC 2013
Author: pfg
Date: Sun Jun 30 00:42:51 2013
New Revision: 252397
URL: http://svnweb.freebsd.org/changeset/base/252397
Log:
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
Modified:
head/sys/fs/ext2fs/ext2_vfsops.c
Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c Sat Jun 29 23:58:16 2013 (r252396)
+++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Jun 30 00:42:51 2013 (r252397)
@@ -979,7 +979,7 @@ ext2_vget(struct mount *mp, ino_t ino, i
* 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;
}
More information about the svn-src-all
mailing list