Kernel 5.1: fstrim bug potentially causing data loss?!

Just came across this one: https://bugs.archlinux.org/task/62693
It was mentioned in the openSUSE factory mailing list.The title says all about a potentially massive data loss.

Please, what now? Disable fstrim immediately? What about the circumstances mentioned? Is a Btrfs root partition (unencrypted) safe? I figure there is no easy way of going back to kernel 5.0 with Tumbleweed where only two kernel versions are installed simultaneously; I figure it might not be worth it to revert to an older Btrfs snapshot (never had to up to now).

One reference here: https://www.reddit.com/r/archlinux/comments/brbvo7/psa_fstrim_discarding_too_many_or_wrong_blocks_on/

Hard to know for sure. But it looks as if you are safe with unencrypted “btrfs” (because that does not use the device-mapper).

As for going back to a 5.0 kernel – that would be easy here. I will have a 5.0 kernel available until a 5.2 kernel arrives.

What I do, is add “oldest” to the criteria for keeping kernels:

multiversion.kernels = oldest,latest,latest-1,running

(that’s a line in “/etc/zypp/zypp.conf”). That kept a 4.20 kernel around for a while. But once 5.1 arrived, I deleted the 4.20 kernel. So now the last 5.0 kernel was the oldest and will be kept around until I delete that. This seems like a good safety move with Tumbleweed.

Oh yes, multiversion.kernel sounds good. Unfortunately, I am not sure what the default behavior of a fairly recent TW install is, since I am not at my PC until tomorrow. I know for sure it keeps two kernels only, but I am not sure whether I have two 5.1 versions, i.e. 5.1.3 and 5.1.2 as per the TW default and successive zypper dup’s, or whether I have a 5.1 and a 5.0. Uhhh…Ugly stuff with such a kernel bug , and with the bug occurrence conditions still being murky.

Last of each kernel point release is available to those who don’t mind a little repositories/ digging. I’m not including any whole URL because Takashi did not when he announced this:
https://lists.opensuse.org/opensuse-factory/2019-05/msg00153.html
repositories/home:/tiwai:/kernel:/