summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-07-01 14:49:23 +0000
committerpfg <pfg@FreeBSD.org>2013-07-01 14:49:23 +0000
commitb8949bad09bc1adeec3760744e711f045aa131ff (patch)
tree536af6d7bb052dce580e45cb758b611fa638f065 /sys/ufs/ffs
parent4a24ccbeb99b45c86587b00b80e7b7fa9131e4fe (diff)
downloadFreeBSD-src-b8949bad09bc1adeec3760744e711f045aa131ff.zip
FreeBSD-src-b8949bad09bc1adeec3760744e711f045aa131ff.tar.gz
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
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 19b5615..57d86db 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -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);
OpenPOWER on IntegriCloud