I experienced the errors 400 problem on an HDD and how I fixed it is in comment 2 in this bug: https://bugzilla.kernel.org/show_bug.cgi?id=90071
The gist is to find out what file is affected by finding the path/filename for the inode with the error and then deleting it. You'll need to recover the file from backups. Once you do this the problem is resolved, the file system itself is OK. (At least it was in my case.) I don't know that the source of the problem you're having has anything to do with trim, but I recommend not using discard or fstrim at all until you isolate what's causing it. There are some trim bugs that have been fixed in newer kernels that sound like the problem you're having; and there are definitely some SSDs out there with trim problems where the wrong sectors get trimmed. It shows up as files with 512 byte holes of zeros in them. Of course, that's when the bug affects data. If it affects metadata it can obliterate the file system beyond repair. Chris Murphy -- 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