From owner-svn-src-head@FreeBSD.ORG Mon Jul 1 21:43:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9833CF8; Mon, 1 Jul 2013 21:43:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4C413A9; Mon, 1 Jul 2013 21:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LheAp067177; Mon, 1 Jul 2013 21:43:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61Lhemi067176; Mon, 1 Jul 2013 21:43:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307012143.r61Lhemi067176@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 1 Jul 2013 21:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252484 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 21:43:40 -0000 Author: pfg Date: Mon Jul 1 21:43:40 2013 New Revision: 252484 URL: http://svnweb.freebsd.org/changeset/base/252484 Log: Change i_gen in UFS to an unsigned type. Revert the simplification of the i_gen calculation. It is still a good idea to avoid zero values and for the case of old filesystems there is probably no advantage in using the complete 32 bits anyways. Discussed with: bde 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 21:41:12 2013 (r252483) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Jul 1 21:43:40 2013 (r252484) @@ -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(); + ip->i_gen = arc4random()/2 + 1; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { ip->i_flag |= IN_MODIFIED; DIP_SET(ip, i_gen, ip->i_gen);