public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Vaughan <cxt9401@163.com>, linux-xfs@vger.kernel.org
Subject: Re: How to get disk-location from "metadata I/O error"?
Date: Tue, 19 Dec 2017 08:41:44 +1100	[thread overview]
Message-ID: <20171218214144.GE4094@dastard> (raw)
In-Reply-To: <20171218154149.ijynq53b446vlmfm@odin.usersys.redhat.com>

On Mon, Dec 18, 2017 at 04:41:50PM +0100, Carlos Maiolino wrote:
> On Mon, Dec 18, 2017 at 07:16:33PM +0800, Vaughan wrote:
> > Hi All,
> > 
> > 
> > I encounter the following output from time to time. Since xfs is built on
> > our own virtual disk, it's more likely that our vdisk is buggy.
> > Can anyone tell me how to figure out the on-disk location given the block
> > number? Does it follow the following formula?
> > On-disk location = <block number from metadata I/O error> * <bsize of data
> > section of xfs_info>
> > However, the result from the above formula suggests the metadata is out of
> > range of my disk, confused...
> 
> No, your formula is not correct. XFS filesystem blocks are not exactly
> sequentially arranged as your formula suggests. It depends on the number of
> blocks in each Allocation Group, and the Log2 number used to make calculations
> regarding disk addresses.
> 
> Easier answer: Use xfs_db to convert it:
> 
> xfs_db> fsblock 0x1e8ffa08
> xfs_db> daddr
> current daddr is 2639245888

One little, important detail is wrong here: metadata block numbers
are reported as daddrs, not fsblocks. daddrs are units of basic
blocks and are a linear offset from the start of the device. Basic
blocks are always 512 bytes. i.e. neither the OP or the above is
correct. :/

XFS (md_d27): metadata I/O error: block 0x1e8ffa08 ("xfs_trans_read_buf_map") error 117 numblks 8 

Hence this is an error from a read at daddr 0x1e8ffa08 for 8 basic
blocks (4096 bytes). Looks like something has overwritten the AGF
with crap...

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2017-12-18 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 11:16 How to get disk-location from "metadata I/O error"? Vaughan
2017-12-18 15:41 ` Carlos Maiolino
2017-12-18 21:41   ` Dave Chinner [this message]

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=20171218214144.GE4094@dastard \
    --to=david@fromorbit.com \
    --cc=cxt9401@163.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