From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:24288 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbdIRUWy (ORCPT ); Mon, 18 Sep 2017 16:22:54 -0400 Date: Mon, 18 Sep 2017 13:22:49 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 06/12] xfs: move inode fork verifiers to xfs_dinode_verify Message-ID: <20170918202249.GS6540@magnolia> References: <150394418979.24826.12970283067445908653.stgit@magnolia> <150394422787.24826.14809466383851827337.stgit@magnolia> <20170906164406.GF55280@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170906164406.GF55280@bfoster.bfoster> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Brian Foster Cc: linux-xfs@vger.kernel.org On Wed, Sep 06, 2017 at 12:44:07PM -0400, Brian Foster wrote: > On Mon, Aug 28, 2017 at 11:17:07AM -0700, Darrick J. Wong wrote: > > From: Darrick J. Wong > > > > Consolidate the fork size and format verifiers to xfs_dinode_verify so > > that we can reject bad inodes earlier and in a single place. > > > > Signed-off-by: Darrick J. Wong > > --- > > fs/xfs/libxfs/xfs_inode_buf.c | 68 ++++++++++++++++++++++++++- > > fs/xfs/libxfs/xfs_inode_fork.c | 99 ---------------------------------------- > > 2 files changed, 65 insertions(+), 102 deletions(-) > > > > > ... > > diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c > > index 0e80f34..bba45f1 100644 > > --- a/fs/xfs/libxfs/xfs_inode_fork.c > > +++ b/fs/xfs/libxfs/xfs_inode_fork.c > > @@ -61,70 +61,11 @@ xfs_iformat_fork( > ... > > - if (unlikely(xfs_is_reflink_inode(ip) && > > - (VFS_I(ip)->i_mode & S_IFMT) != S_IFREG)) { > > - xfs_warn(ip->i_mount, > > - "corrupt dinode %llu, wrong file type for reflink.", > > - ip->i_ino); > > - XFS_CORRUPTION_ERROR("xfs_iformat(reflink)", > > - XFS_ERRLEVEL_LOW, ip->i_mount, dip); > > - return -EFSCORRUPTED; > > - } Oops, this wasn't supposed to be dropped. > > - > > - if (unlikely(xfs_is_reflink_inode(ip) && > > - (ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) { > > - xfs_warn(ip->i_mount, > > - "corrupt dinode %llu, has reflink+realtime flag set.", > > - ip->i_ino); > > - XFS_CORRUPTION_ERROR("xfs_iformat(reflink)", > > - XFS_ERRLEVEL_LOW, ip->i_mount, dip); > > - return -EFSCORRUPTED; > > - } > > It looks like a couple of these reflink inode checks have disappeared. > Intentional? xfs_dinode_verify already checked this. > ... > > @@ -209,18 +122,6 @@ xfs_iformat_fork( > > atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); > > size = be16_to_cpu(atp->hdr.totsize); > > > > - if (unlikely(size < sizeof(struct xfs_attr_sf_hdr))) { > > - xfs_warn(ip->i_mount, > > - "corrupt inode %Lu (bad attr fork size %Ld).", > > - (unsigned long long) ip->i_ino, > > - (long long) size); > > - XFS_CORRUPTION_ERROR("xfs_iformat(8)", > > - XFS_ERRLEVEL_LOW, > > - ip->i_mount, dip); > > - error = -EFSCORRUPTED; > > - break; > > - } > > - > > Same question here..? This check is included in the next patch that creates inline attr fork verifiers, but you're right that this chunk doesn't belong here. --D > > Brian > > > error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); > > break; > > case XFS_DINODE_FMT_EXTENTS: > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html