diff options
author | Mike Pechkin <mpech@cvs.openbsd.org> | 2003-10-17 15:08:12 +0000 |
---|---|---|
committer | Mike Pechkin <mpech@cvs.openbsd.org> | 2003-10-17 15:08:12 +0000 |
commit | 50ec88b0da1cbba45ffd7b9fd0645a6e942211c3 (patch) | |
tree | 47052e4e5ff617bac06406d022472fb223dbcdf6 /sys/ufs/ffs/ffs_vfsops.c | |
parent | b4b88fca02ed03d264249b2a7327e1f462338491 (diff) |
Be sure i_ffs_gen is always positive.
millert@, beck@, tedu@, deraadt@ ok
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index dcaacc3b195..4d0e448eba8 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.60 2003/10/04 18:47:08 mickey Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.61 2003/10/17 15:08:11 mpech Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1232,7 +1232,7 @@ retry: * already have one. This should only happen on old filesystems. */ if (ip->i_ffs_gen == 0) { - ip->i_ffs_gen = arc4random(); + ip->i_ffs_gen = arc4random() & INT_MAX; if (ip->i_ffs_gen == 0 || ip->i_ffs_gen == -1) ip->i_ffs_gen = 1; /* shouldn't happen */ if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) |