svn commit: r252467 - head/sys/ufs/ffs
Pedro F. Giffuni
pfg at FreeBSD.org
Mon Jul 1 14:49:24 UTC 2013
Author: pfg
Date: Mon Jul 1 14:49:23 2013
New Revision: 252467
URL: http://svnweb.freebsd.org/changeset/base/252467
Log:
Change i_gen in UFS to an unsigned type.
Further simplify the i_gen calculation for older disks.
Having a zero here is not really a problem and this is more
similar to what is done in newfs_random().
Reported by: Xin Li
MFC after: 4 weeks
Modified:
head/sys/ufs/ffs/ffs_vfsops.c
Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:45:03 2013 (r252466)
+++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 14:49:23 2013 (r252467)
@@ -1791,7 +1791,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
* already have one. This should only happen on old filesystems.
*/
if (ip->i_gen == 0) {
- ip->i_gen = arc4random() + 1;
+ ip->i_gen = arc4random();
if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
ip->i_flag |= IN_MODIFIED;
DIP_SET(ip, i_gen, ip->i_gen);
More information about the svn-src-all
mailing list