On 12/01/2014 01:26 AM, Gour wrote:
On Mon, 01 Dec 2014 09:06:19 +1100
Russell Coker <russ...@coker.com.au> wrote:

When the 2 disks have different data mdadm has no way of knowing
which one is correct and has a 50% chance of overwriting good data.
But BTRFS does checksums on all reads and solves the problem of
corrupt data - as long as you don't have 2 corrupt sectors in
matching blocks.

Hmm, this is very interesting and valuable info. Thank you.


Don't get too excited. If the data disagrees in either system because of partial starts (e.g. one mount /dev/sda1 is hot, the next mount /dev/sdb1 is hot) leaving both disks with equally valid but disagreeing data, "magical guessing" _will_ ensue.

In the BTRFS case the system will guess based on generation numbers.

In the MDADM case the system will guess based on the write intent bitmaps.

In both cases, you are _way_ better off invalidating any missing array elements if you find yourself reaching a write-available event with said missing elements.

BTRFS checksums really help when a write goes to both devices (e.g. /dev/sda1 and /dev/sdb1) and the disk subsystem silently fails one of the necessary writes, creating a disagreement between the checksum and the data block on the drive in question.

It's an outstanding feature, but it doesn't protect you from weak maintenance after a partial start.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to