On Tue, Mar 24, 2020 at 9:01 PM Chao Yu <yuch...@huawei.com> wrote:
> I guess ssd should support discard, however I saw sdb was wrapped with device
> mapper, which may have different character, just want to check that whether
> device mapper disable the discard.
> If backup/restore is hard for you, how about let me add some logs on fstrim
> interface? then we could retry fstrim to see where we actually fail.

I have an older totally different SSD for testing that seems to support discard:
# hdparm -I /dev/sdc | grep TRIM
   * Data Set Management TRIM supported (limit 8 blocks)
   * Deterministic read ZEROs after TRIM

As I test, I created two f2fs partitions on this different SSD:
1) /dev/sdc2 normal F2FS
2) /dev/sdc3 encrypted with LUKS (dm-crypt) then formatted to F2FS

1) Regular F2FS
# fstrim -v /regular
/regular: 0 B (0 bytes) trimmed

2) Encrypted F2FS
# fstrim -v /encrypted
fstrim: /encrypted: the discard operation is not supported

Can we conclude that the device mapper is some how spoofing fstrim
into thinking the device doesn't support trim?  Happy to hear your

Linux-f2fs-devel mailing list

Reply via email to