linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 06/12] xfs: move inode fork verifiers to xfs_dinode_verify
Date: Wed, 6 Sep 2017 12:44:07 -0400	[thread overview]
Message-ID: <20170906164406.GF55280@bfoster.bfoster> (raw)
In-Reply-To: <150394422787.24826.14809466383851827337.stgit@magnolia>

On Mon, Aug 28, 2017 at 11:17:07AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> 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 <darrick.wong@oracle.com>
> ---
>  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;
> -	}
> -
> -	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?

...
> @@ -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..?

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

  reply	other threads:[~2017-09-06 16:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 18:16 [PATCH 00/12] xfs: more and better verifiers Darrick J. Wong
2017-08-28 18:16 ` [PATCH 01/12] xfs: refactor long-format btree header verification routines Darrick J. Wong
2017-08-28 18:16 ` [PATCH 02/12] xfs: remove XFS_WANT_CORRUPTED_RETURN from dir3 data verifiers Darrick J. Wong
2017-08-28 18:16 ` [PATCH 03/12] xfs: have buffer verifier functions report failing address Darrick J. Wong
2017-08-28 18:16 ` [PATCH 04/12] xfs: refactor verifier callers to print address of failing check Darrick J. Wong
2017-09-06 16:43   ` Brian Foster
2017-09-18 19:29     ` Darrick J. Wong
2017-08-28 18:17 ` [PATCH 05/12] xfs: verify dinode header first Darrick J. Wong
2017-09-06 16:43   ` Brian Foster
2017-09-18 19:45     ` Darrick J. Wong
2017-08-28 18:17 ` [PATCH 06/12] xfs: move inode fork verifiers to xfs_dinode_verify Darrick J. Wong
2017-09-06 16:44   ` Brian Foster [this message]
2017-09-18 20:22     ` Darrick J. Wong
2017-08-28 18:17 ` [PATCH 07/12] xfs: create structure verifier function for shortform xattrs Darrick J. Wong
2017-08-28 18:17 ` [PATCH 08/12] xfs: create structure verifier function for short form symlinks Darrick J. Wong
2017-08-28 18:17 ` [PATCH 09/12] xfs: refactor short form directory structure verifier function Darrick J. Wong
2017-08-28 18:17 ` [PATCH 10/12] xfs: provide a centralized method for verifying inline fork data Darrick J. Wong
2017-08-28 18:17 ` [PATCH 11/12] xfs: fail out of xfs_attr3_leaf_lookup_int if it looks corrupt Darrick J. Wong
2017-08-28 18:17 ` [PATCH 12/12] xfs: create a new buf_ops pointer to verify structure metadata Darrick J. Wong
2017-09-06 16:47   ` Brian Foster
2017-09-18 20:32     ` Darrick J. Wong
2017-09-19 14:52       ` Brian Foster
2017-09-19 17:24         ` Darrick J. Wong
2017-09-06 16:43 ` [PATCH 00/12] xfs: more and better verifiers Brian Foster
2017-09-18 20:23   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2017-08-17 23:31 [RFC " Darrick J. Wong
2017-08-17 23:32 ` [PATCH 06/12] xfs: move inode fork verifiers to xfs_dinode_verify Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170906164406.GF55280@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).