Date: Mon, 1 Jul 2013 14:49:23 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252467 - head/sys/ufs/ffs Message-ID: <201307011449.r61EnOjP043954@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307011449.r61EnOjP043954>