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
This commit is contained in:
parent
4a24ccbeb9
commit
b8949bad09
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user