From owner-svn-src-head@freebsd.org Mon Jan 29 22:15:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E4DEE1E8D; Mon, 29 Jan 2018 22:15:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAACF699CB; Mon, 29 Jan 2018 22:15:46 +0000 (UTC) (envelope-from fsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1AF86555; Mon, 29 Jan 2018 22:15:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0TMFkrG019837; Mon, 29 Jan 2018 22:15:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0TMFkjB019836; Mon, 29 Jan 2018 22:15:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201801292215.w0TMFkjB019836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Mon, 29 Jan 2018 22:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328566 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328566 X-SVN-Commit-Repository: base 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.25 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, 29 Jan 2018 22:15:47 -0000 Author: fsu Date: Mon Jan 29 22:15:46 2018 New Revision: 328566 URL: https://svnweb.freebsd.org/changeset/base/328566 Log: Fix mistake in case of zeroed inode check. Reported by: pho MFC after: 6 months Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Mon Jan 29 22:03:01 2018 (r328565) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Mon Jan 29 22:15:46 2018 (r328566) @@ -90,8 +90,10 @@ ext2_print_inode(struct inode *in) int ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { + struct m_ext2fs *fs; const static struct ext2fs_dinode ei_zero; + fs = ip->i_e2fs; ip->i_nlink = ei->e2di_nlink; /* * Godmar thinks - if the link count is zero, then the inode is @@ -135,7 +137,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) memcpy(ip->i_data, ei->e2di_blocks, sizeof(ei->e2di_blocks)); - if (memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && + memcmp(ei, &ei_zero, EXT2_INODE_SIZE(fs))) return (ext2_ei_csum_verify(ip, ei)); return (0);