From owner-svn-src-stable@freebsd.org Thu Apr 14 01:24:01 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B525B0EF84; Thu, 14 Apr 2016 01:24:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 525261D24; Thu, 14 Apr 2016 01:24:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3E1O0vV073269; Thu, 14 Apr 2016 01:24:00 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3E1O0bQ073267; Thu, 14 Apr 2016 01:24:00 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201604140124.u3E1O0bQ073267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 14 Apr 2016 01:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297950 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2016 01:24:01 -0000 Author: kevlo Date: Thu Apr 14 01:24:00 2016 New Revision: 297950 URL: https://svnweb.freebsd.org/changeset/base/297950 Log: MFC r297479, r297695: Update comment: Linux does set a randomized generation number of an inode on ext2/3/4. While here use arc4random() instead of random(). Reviewed by: pfg Modified: stable/10/sys/fs/ext2fs/ext2_alloc.c stable/10/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_alloc.c Thu Apr 14 01:20:15 2016 (r297949) +++ stable/10/sys/fs/ext2fs/ext2_alloc.c Thu Apr 14 01:24:00 2016 (r297950) @@ -406,10 +406,8 @@ ext2_valloc(struct vnode *pvp, int mode, /* * Set up a new generation number for this inode. - * XXX check if this makes sense in ext2 */ - if (ip->i_gen == 0 || ++ip->i_gen == 0) - ip->i_gen = random() / 2 + 1; + ip->i_gen = arc4random(); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Apr 14 01:20:15 2016 (r297949) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Thu Apr 14 01:24:00 2016 (r297950) @@ -308,8 +308,8 @@ ext2_check_sb_compat(struct ext2fs *es, } /* - * This computes the fields of the ext2_sb_info structure from the - * data in the ext2_super_block structure read in. + * This computes the fields of the m_ext2fs structure from the + * data in the ext2fs structure read in. */ static int compute_sb_data(struct vnode *devvp, struct ext2fs *es, @@ -600,7 +600,7 @@ ext2_mountfs(struct vnode *devvp, struct /* * I don't know whether this is the right strategy. Note that - * we dynamically allocate both an ext2_sb_info and an ext2_super_block + * we dynamically allocate both an m_ext2fs and an ext2fs * while Linux keeps the super block in a locked buffer. */ ump->um_e2fs = malloc(sizeof(struct m_ext2fs),