Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 2019 12:01:43 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Dave Baukus <daveb@spectralogic.com>, "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   Re: zdb question
Message-ID:  <94cf983c-c049-090c-c9ea-76b25e8036b9@FreeBSD.org>
In-Reply-To: <7115e017-f9d1-452b-93d7-e2dbcf67618d@spectralogic.com>
References:  <7115e017-f9d1-452b-93d7-e2dbcf67618d@spectralogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 28/02/2019 15:59, Dave Baukus wrote:
> If one uses zdb -R <pool name> <dva> to read the contents of every disk block
> associated with the DVA in a raidz2 pool then does one expect the
> dump of each DVA to be the exact USER WRITTEN contents of the file ?

I think so; on a condition that the DVA refers to the file's data block (L0).

> Or does this usage of zdb pull in the raidz2 checksum blocks and/or padding ?
> Looking at the code, I don't think so.
> 
> I ask because I have a file of known contents (every byte was written as 0x42 == 'B'),
> and if I execute the script below and redirect the output to a file then
> the contents of the output file has chunks of non-B characters.
> 
> For example:
> 
> Offset 300000, DVA 1:9f08e2ff000:120000

How did you come up with this DVA?
Are you sure about the size component?

> Found vdev type: raidz
> 
> 1:9f08e2ff000:120000
>            0 1 2 3 4 5 6 7   8 9 a b c d e f  0123456789abcdef
> 010000:  01000321b60d0000  0afb2f931d805100  ....!....Q.../..
> 010010:  02ac211c00020f00  00e2000680110031  .....!..1.......
> 010020:  39345f58656c6966  0f001334322e3639  fileX_4996.24...
> 010030:  050040cb1f0c0002  02020c003a35352f  .....@../55:....
> 010040:  3822050040ea1f00  210c00020f002136  ...@.."86!.....!
> 
> -----
> 
> Whereas I expect every DVA chunk to look like:
> 
> Offset 0, DVA 1:9f08e0bf000:120000
> Found vdev type: raidz
> 
> 1:9f08e0bf000:120000
>            0 1 2 3 4 5 6 7   8 9 a b c d e f  0123456789abcdef
> 000000:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000010:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000020:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000030:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000040:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 
> ----
> 
> On the other hand, if I use a simple program to read the file and verify that every byte
> is 0x42 then no errors are reported.
> 
> What gives ?
> Am I misusing zdb ?

Perhaps.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?94cf983c-c049-090c-c9ea-76b25e8036b9>