On 5/27/20 8:40 PM, Chris Murphy wrote:
On Wed, May 27, 2020 at 10:23 AM Goffredo Baroncelli <kreijack@xxxxxxxxx> wrote:
Hi All,
On 5/27/20 8:25 AM, Chris Murphy wrote:
On Tue, May 26, 2020 at 11:22 PM Andrei Borzenkov <arvidjaar@xxxxxxxxx> wrote:
27.05.2020 05:20, Chris Murphy пишет:
single, dup, raid0, raid1 (all), raid10 are safe and stable.
Until btrfs can reliably detect and automatically handle outdated device
I would not call any multi-device profiles "safe", at least unconditionally.
I agree.
Checking the generation of each device should be sufficient to detect "outdated" devices. Why this check is not performed ?
May be that I am missing something ?
But transid isn't unique enough except in isolation. Degraded volumes
are treated completely independently. So if I take a 2x raid1 and
mount each one degraded on separate computers and modify them. Then
join them back together, how can Btrfs resolve the differences? It's a
mess. Yes that is obviously a kind of sabotage. While not literal
sabotage, the effect is the same if you have alternating degraded
drives in successive boots.
Even tough we can't close all the holes, we can reduce the likelihood of a this issue.
Anyway mounting a filesystem with different generation number is wrong. And the
fact the we can't prevent all the kind of mismatches doesn't mean that
we don't have to do anything.
I am thinking about adding a "opt in" check. I.e. if the mismatch happens
btrfs should raise a warning. If a flag is passed at mount (like
mount -o prevent-generation-mismatch) and the generations don't match,
the mount fails.
Then, on the basis of feedback returned, in the future we can change the
flags from "opt in" to "opt out" (mount -o no-prevent-generation-mismatch)
So you just cannot use degraded with either fstab or rootflags. It's
bad advice to anyone who gives it and we need to be vigilant about
recommending against it. Maybe the man 5 btrfs page should expressly
say not to include degraded in fstab, or at least warn there are
consequences.
--
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5