Hi Mikulas,

thank you for the careful review, and for pointing straight at what
needs to be fixed.  We agree with you: the 1/2 sent earlier only hides
the symptom, please ignore it.

To make sure we read the defect the same way: in fec_read_bufs() a block
whose read fails is recorded as an erasure outright; a block that reads
back fine and lives on the data device is judged by fec_is_erasure(),
which compares it against the digest verity_hash_for_block() produced
for it.  Getting that digest can walk the hash tree and read, level by
level, the hash block covering that data block.  When the block being
recovered is itself a metadata block, a data block of the same codeword
can have its hash path run through it - at level 0 one of the data
blocks it covers, above level 0 one of the hash blocks below it.  So
the walk asks for exactly the block we are rebuilding: the one
dm_bufio_new() put in the cache holding allocator leftovers, with no
read ever issued for it.  The digest cannot match, recursion into FEC
is blocked by fio->level, and the walk ends in verity_handle_err() -
the "metadata block N is corrupted" from our devices, which under
restart_on_corruption means a reboot on a single transient read error.
This is only reachable on the second try, the one that asks for
erasures: the first try recovers the block without searching for them.

Rather than defending a patch of our own, what we would really
appreciate is your help with the complete fix.  This is a path where a
partial change worries us: the erasure search, the recursion guard in
verity_fec_decode() and the hash_verified state are all involved, and
from the outside we cannot judge which of them a correct fix has to
touch.  Our concern is that we close the case we can see and open
another risk somewhere we cannot.

Would you describe the fix you would consider correct - where the
change belongs, and what else it has to cover?  We will implement it
exactly as you specify, verify it on the configuration that reproduces
the problem, and send it to you for review before it goes any further.

Thanks again for your time,
Weijiang
________________________________
 This email (including its attachments) is intended only for the person or 
entity to which it is addressed and may contain information that is privileged, 
confidential or otherwise protected from disclosure. Unauthorized use, 
dissemination, distribution or copying of this email or the information herein 
or taking any action in reliance on the contents of this email or the 
information herein, by anyone other than the intended recipient, or an employee 
or agent responsible for delivering the message to the intended recipient, is 
strictly prohibited. If you are not the intended recipient, please do not read, 
copy, use or disclose any part of this e-mail to others. Please notify the 
sender immediately and permanently delete this e-mail and any attachments if 
you received it in error. Internet communications cannot be guaranteed to be 
timely, secure, error-free or virus-free. The sender does not accept liability 
for any errors or omissions.
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、
 
使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。

Reply via email to