Does the discard bug introduced in 4.19 by 744889b7cbb56a6 and fixed by 1adfc5e4136f5967 have potential for fstrim-caused corruption?

From: Vito Caputo
Date: Sat Nov 10 2018 - 03:09:46 EST


I ask because I recently performed some fstrims on my 4.19-running
laptop after a good house cleaning, and things started going rather
haywire today at the filesystem level, on different filesystems of
differing types (ext2 and ext4) but sharing the same underlying lvm
pv+dmcrypt on an SSD.

At the time I needed to get work done and couldn't investigate. So I
crossed my fingers and rebooted back into 4.18, let some ugly fscks
complete, and carried on like nothing happened.

This all seems to be a software bug, not a genuine SSD failure of any
sort.

My filesystems are now all in a questionable state, though the machine
seems usable enough for the moment while I prepare for rebuilding.

Should I assume this was all caused by the fstrims and 744889b7cbb56a6?

Or does it not explain how this happened and we may have a different
problem on our hands?

I had been running 4.19-rc[178], but am uncertain if I performed fstrims
in any of those, I definitely did in 4.18 though and had no trouble.

744889b7cbb56a6 is especially suspect to me as it was in none of the
4.19 RCs but for some reason landed in 4.19 to fix a22c4d7e34402ccdf3,
even though a22c4d7e34402ccdf3 has been there since 4.3, that's left a
bad taste in my mouth but maybe I'm missing something.

Thanks,
Vito Caputo