public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs_repair: complain about ag header crc errors
Date: Mon, 29 Jun 2020 08:20:31 -0400	[thread overview]
Message-ID: <20200629122031.GA10449@bfoster> (raw)
In-Reply-To: <159311835284.1065505.8957820680195453723.stgit@magnolia>

On Thu, Jun 25, 2020 at 01:52:32PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Repair doesn't complain about crc errors in the AG headers, and it
> should.  Otherwise give the admin the wrong impression about the
> state of the filesystem after a nomodify check.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  repair/scan.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> 
> diff --git a/repair/scan.c b/repair/scan.c
> index 505cfc53..42b299f7 100644
> --- a/repair/scan.c
> +++ b/repair/scan.c
> @@ -2441,6 +2441,8 @@ scan_ag(
>  		objname = _("root superblock");
>  		goto out_free_sb;
>  	}
> +	if (sbbuf->b_error == -EFSBADCRC)
> +		do_warn(_("superblock has bad CRC for ag %d\n"), agno);

So salvage_buffer() reads the buf and passes along the verifier. If the
verifier fails, we ignore the error and return 0 because of
LIBXFS_READBUF_SALVAGE, but leave it set in bp->b_error so it should be
accessible here. Looks Ok:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  	libxfs_sb_from_disk(sb, sbbuf->b_addr);
>  
>  	error = salvage_buffer(mp->m_dev,
> @@ -2450,6 +2452,8 @@ scan_ag(
>  		objname = _("agf block");
>  		goto out_free_sbbuf;
>  	}
> +	if (agfbuf->b_error == -EFSBADCRC)
> +		do_warn(_("agf has bad CRC for ag %d\n"), agno);
>  	agf = agfbuf->b_addr;
>  
>  	error = salvage_buffer(mp->m_dev,
> @@ -2459,6 +2463,8 @@ scan_ag(
>  		objname = _("agi block");
>  		goto out_free_agfbuf;
>  	}
> +	if (agibuf->b_error == -EFSBADCRC)
> +		do_warn(_("agi has bad CRC for ag %d\n"), agno);
>  	agi = agibuf->b_addr;
>  
>  	/* fix up bad ag headers */
> 


  reply	other threads:[~2020-06-29 20:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 20:52 [PATCH 0/2] xfs_repair: more fixes Darrick J. Wong
2020-06-25 20:52 ` [PATCH 1/2] xfs_repair: complain about ag header crc errors Darrick J. Wong
2020-06-29 12:20   ` Brian Foster [this message]
2020-06-29 23:11     ` Darrick J. Wong
2020-06-25 20:52 ` [PATCH 2/2] xfs_repair: try to fill the AGFL before we fix the freelist Darrick J. Wong
2020-06-29 12:22   ` Brian Foster
2020-06-29 23:21     ` Darrick J. Wong
2020-06-30 10:52       ` Brian Foster
2020-07-01 16:19         ` 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=20200629122031.GA10449@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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