diff options
author | Renato Botelho <renato@netgate.com> | 2016-06-14 14:40:19 -0500 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-06-14 14:40:19 -0500 |
commit | 20a32898b6944f9ebcdbb846253d812943036066 (patch) | |
tree | 2d3bb1c4acf6d65a66c132d4c59643a3e99dfe34 /sys/fs/ext2fs/ext2_alloc.c | |
parent | 4fdb7654ef71cc3e4f0353cc46f28f652cd35605 (diff) | |
parent | a048478c507785f68e86db1a32431aa36773ee06 (diff) | |
download | FreeBSD-src-20a32898b6944f9ebcdbb846253d812943036066.zip FreeBSD-src-20a32898b6944f9ebcdbb846253d812943036066.tar.gz |
Merge remote-tracking branch 'origin/master' into devel-11
Diffstat (limited to 'sys/fs/ext2fs/ext2_alloc.c')
-rw-r--r-- | sys/fs/ext2fs/ext2_alloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/fs/ext2fs/ext2_alloc.c b/sys/fs/ext2fs/ext2_alloc.c index 35e24c3..e0201cc 100644 --- a/sys/fs/ext2fs/ext2_alloc.c +++ b/sys/fs/ext2fs/ext2_alloc.c @@ -407,9 +407,11 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp) /* * Set up a new generation number for this inode. + * Avoid zero values. */ - while (ip->i_gen == 0 || ++ip->i_gen == 0) + do { ip->i_gen = arc4random(); + } while ( ip->i_gen == 0); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; |