In the corrective release of the kernel the issue lies within the DM (Device Mapper) subsystem, which leads to data corruption on SSD drives. The issue began to manifest after , introduced in the kernel in January of this year, affects only the 5.1 branch and predominantly occurs on systems with Samsung SSDs that use data encryption with dm-crypt/LUKS over device-mapper/LVM.
The cause of the problem is overly aggressive marking of freed blocks through FSTRIM (too many sectors were marked at once, ignoring the max_io_len_target_boundary limit). The error has already been fixed in the distributions offering kernel 5.1 , but remains unpatched in (the fix is available but is currently in the 'testing' branch). A workaround for blocking the issue involves disabling the fstrim.service/timer, temporarily renaming the fstrim executable, removing the 'discard' flag from the mount options in fstab, and disabling the 'allow-discards' mode in LUKS through dmsetup.
Source: opennet.ru
