Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2021 12:40:30 +0100
From:      Stefan Esser <se@freebsd.org>
To:        Karl Denninger <karl@denninger.net>, freebsd-fs@freebsd.org
Subject:   Re: Reading a corrupted file on ZFS
Message-ID:  <06e62e4c-6f9e-4cfd-d662-78b8b4dfbf21@freebsd.org>
In-Reply-To: <3aeb9d42-f69d-1f4c-b1f5-74dd4d28578c@denninger.net>
References:  <da892eeb-233f-551f-2faa-62f42c3c1d5b@artem.ru> <0ca45adf-8f60-a4c3-6264-6122444a3ffd@denninger.net> <899c6b4f-2368-7ec2-4dfe-fa09fab35447@artem.ru> <20210212165216.2f613482@fabiankeil.de> <10977ffc-f806-69dd-0cef-d4fd4fc5f649@artem.ru> <2f82f113-9ca1-99a9-a433-89e3ae5edcbe@denninger.net> <2bf4f69c-9d5d-5ff9-0daa-c87515437ca3@artem.ru> <5aa03138-1dc8-5a9c-1be6-d47ed22fc0cf@denninger.net> <225e4da5-79ec-a57a-90e5-35989e6484d5@freebsd.org> <3aeb9d42-f69d-1f4c-b1f5-74dd4d28578c@denninger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--PV58Vz1S3UI6WqlQ1X6PWLlpVGZ34ifyu
Content-Type: multipart/mixed; boundary="9meMAz6IgCAX2ddGb5FMox3xlca6hQnsS";
 protected-headers="v1"
From: Stefan Esser <se@freebsd.org>
To: Karl Denninger <karl@denninger.net>, freebsd-fs@freebsd.org
Message-ID: <06e62e4c-6f9e-4cfd-d662-78b8b4dfbf21@freebsd.org>
Subject: Re: Reading a corrupted file on ZFS
References: <da892eeb-233f-551f-2faa-62f42c3c1d5b@artem.ru>
 <0ca45adf-8f60-a4c3-6264-6122444a3ffd@denninger.net>
 <899c6b4f-2368-7ec2-4dfe-fa09fab35447@artem.ru>
 <20210212165216.2f613482@fabiankeil.de>
 <10977ffc-f806-69dd-0cef-d4fd4fc5f649@artem.ru>
 <2f82f113-9ca1-99a9-a433-89e3ae5edcbe@denninger.net>
 <2bf4f69c-9d5d-5ff9-0daa-c87515437ca3@artem.ru>
 <5aa03138-1dc8-5a9c-1be6-d47ed22fc0cf@denninger.net>
 <225e4da5-79ec-a57a-90e5-35989e6484d5@freebsd.org>
 <3aeb9d42-f69d-1f4c-b1f5-74dd4d28578c@denninger.net>
In-Reply-To: <3aeb9d42-f69d-1f4c-b1f5-74dd4d28578c@denninger.net>

--9meMAz6IgCAX2ddGb5FMox3xlca6hQnsS
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Am 13.02.21 um 17:54 schrieb Karl Denninger:
> On 2/13/2021 11:51, Stefan Esser wrote:
>> Therefore: There are valid reasons to not have redundancy and
>> still not loose a large file of data for single bad block of a
>> non-redundant (e.g striped for performance) ZPOOL/ZFS.
>>
>> Regards, STefan
>>
> That's what the patch does -- it allows you to read the file but the=20
> known-bad blocks will be "blanked" (marked that it's no good.)

Yes, I'm well aware of that fact.

I just think we should allow those in this particular error case an
easy way out - and in fact I just noticed that we already do!

> Perhaps that sysctl should be part of the system generally, but you CAN=
=20
> do it the hard way with zdb even without it although it's a SERIOUS pai=
n=20
> in the neck.

While possible with ZDB, nobody will want to do this, if a simple
alternative exists:

$ sysctl vfs.zfs.send
vfs.zfs.send.override_estimate_recordsize: 0
vfs.zfs.send.no_prefetch_queue_ff: 20
vfs.zfs.send.queue_ff: 20
vfs.zfs.send.no_prefetch_queue_length: 1048576
vfs.zfs.send.unmodified_spill_blocks: 1
vfs.zfs.send.queue_length: 16777216
vfs.zfs.send.corrupt_data: 0

These are due to the following lines at the end of
/sys/contrib/openzfs/module/zfs/dmu_send.c:

/* BEGIN CSTYLED */
ZFS_MODULE_PARAM(zfs_send, zfs_send_, corrupt_data, INT, ZMOD_RW,
	"Allow sending corrupt data");

ZFS_MODULE_PARAM(zfs_send, zfs_send_, queue_length, INT, ZMOD_RW,
	"Maximum send queue length");
[...]

Just set vfs.zfs.send.corrupt_data to 1 to have unreadable blocks
returned filled with 0x2f5baddb10c (not 0 as suggested in this thread).

This has been a standard feature of ZFSonLinux for more than 6 years,
apparently, and we have got it with the mapping of module parameters
to sysctl variables ...

Regards, STefan


--9meMAz6IgCAX2ddGb5FMox3xlca6hQnsS--

--PV58Vz1S3UI6WqlQ1X6PWLlpVGZ34ifyu
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmAqXa4FAwAAAAAACgkQR+u171r99USW
Nwf/TfPmw2Wz4+TOu4NYSiqNZ2ACkVCbd6jWFQb2vENDdmFSQbc9aWf7Jvs7NrmX5S917mikWYhZ
KmygRSKp6y2I7qOeXGRVOWNRS4hm779a20S16Jk6Wo7YjamS1mpdqlcmNmjUlkj+R4fMY2kjYqHX
I0AqkNsX/HZNw7W2LzmXRrZ0K7BchTrOkhpRsCiQ3ov+gFay2jirBL7b7UuY2p1i6ABo/Wa+3JRQ
nCZ5vdMcWKqii3nCZMR1FWuj3r19WPyMdGRPgmM/Svozul04gMVd4hc6itg2TCZYVf11fDb1w/Ek
na+p/LPrgtFsC2Tr2lfJf/8BKb8J9MqqyEHJKIgd7w==
=mCgd
-----END PGP SIGNATURE-----

--PV58Vz1S3UI6WqlQ1X6PWLlpVGZ34ifyu--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06e62e4c-6f9e-4cfd-d662-78b8b4dfbf21>