Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jun 2013 00:42:51 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252397 - head/sys/fs/ext2fs
Message-ID:  <201306300042.r5U0gpqr076134@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306300042.r5U0gpqr076134>