All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <phill@thesusis.net>
To: Zhang Boyang <zhangboyang.id@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [IDEA RFC] Forward error correction (FEC) / Error correction code (ECC) for BTRFS
Date: Tue, 21 Jun 2022 09:56:48 -0400	[thread overview]
Message-ID: <87zgi65cn5.fsf@vps.thesusis.net> (raw)
In-Reply-To: <f5cc6c6f-2238-b126-3b0e-00e9e49b0706@gmail.com>


Zhang Boyang <zhangboyang.id@gmail.com> writes:

> Here are some detailed approaches:
>
> 1) Zero-cost approach

<snip>

> 2) Low-cost approach:

Both of these home brew methods rely on guess and check to repair, which
has a high computational cost and the possibility of false repair.  It
also requires that only a minescule amount of silent corruption has
occured.  Disk drives already have highly robust error correction and
detection in place, so it is almost unheard of for them to silently
corrupt data, but rather they refuse to read the whole sector.  If
corrupt data somehow managed to pass the error detection code in the
drive, it is highly likely that a lot more than one or two bytes will be wrong.


> 3) Reed-Solomon approach:

If you are going to do error correction, this or another real FEC
altorithm is the way to go.  Also since the drive reports corrupt
sectors, you can use RS in erasure mode where it can correct T errors
instead of T/2.  There is a handy tool called par2 that lets you create
a small RS FEC archive of a file that you can later use to repair damaged
portions of it.

Another common behavior of drives is for them to fail outright with 100%
data loss rather than just have a few bad sectors.  For that reason, I
think that anyone who really cares about their data should be using a
raid and making regular backups rather than relying on an automatic on
the fly FEC in the filesystem.  If they don't care enough to do that
then they probably don't care enough to think the cost of online FEC is
worth it either.

  parent reply	other threads:[~2022-06-21 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 13:29 [IDEA RFC] Forward error correction (FEC) / Error correction code (ECC) for BTRFS Zhang Boyang
2022-06-21 13:40 ` Zhang Boyang
2022-06-21 13:56 ` Phillip Susi [this message]
2022-06-21 14:25   ` David Sterba
2022-06-21 16:39     ` Zhang Boyang

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=87zgi65cn5.fsf@vps.thesusis.net \
    --to=phill@thesusis.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zhangboyang.id@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.