From: Jaegeuk Kim <jaegeuk@kernel.org>
To: John <graysky@archlinux.us>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] fstrim does not recognize FSVER=1.13 of F2FS partitions
Date: Wed, 25 Mar 2020 08:28:59 -0700 [thread overview]
Message-ID: <20200325152859.GA65658@google.com> (raw)
In-Reply-To: <CAO_nJAaNxRfC6SHQrr0BCDnA2H6HHkz1Pk5vJMCVfGqUSP0u1Q@mail.gmail.com>
On 03/25, John wrote:
> On Tue, Mar 24, 2020 at 9:01 PM Chao Yu <yuchao0@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
>
> Results:
> 1) Regular F2FS
> # fstrim -v /regular
> /regular: 0 B (0 bytes) trimmed
This is normal.
>
> 2) Encrypted F2FS
> # fstrim -v /encrypted
> fstrim: /encrypted: the discard operation is not supported
It seems dm-crypt has discard-related support, ie., "allow_discards", in ctrl.
But, FWIW, the target simply doesn't support discard at all.
# grep discards_supported drivers/md/*
drivers/md/dm-cache-target.c: ti->discards_supported = true;
drivers/md/dm-clone-target.c: ti->discards_supported = true;
drivers/md/dm-log-writes.c: ti->discards_supported = true;
drivers/md/dm-table.c: if (!tgt->num_discard_bios && tgt->discards_supported)
drivers/md/dm-table.c: DMWARN("%s: %s: ignoring discards_supported because num_discard_bios is zero.",
drivers/md/dm-table.c: * 'discards_supported') or it relies on _all_ data devices having
drivers/md/dm-table.c: if (!ti->discards_supported &&
drivers/md/dm-thin.c: * Setting 'discards_supported' circumvents the normal
drivers/md/dm-thin.c: ti->discards_supported = true;
drivers/md/dm-thin.c: ti->discards_supported = true;
drivers/md/dm-zoned-target.c: ti->discards_supported = true;
>
> Can we conclude that the device mapper is some how spoofing fstrim
> into thinking the device doesn't support trim? Happy to hear your
> thoughts.
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-03-25 15:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-14 18:09 [f2fs-dev] fstrim does not recognize FSVER=1.13 of F2FS partitions John
2020-03-16 1:24 ` Chao Yu
2020-03-16 9:52 ` John
2020-03-17 1:44 ` Chao Yu
2020-03-18 20:25 ` John
2020-03-23 4:11 ` Jaegeuk Kim
2020-03-23 10:27 ` John
2020-03-23 15:02 ` Jaegeuk Kim
2020-03-23 20:12 ` John
2020-03-24 2:32 ` Chao Yu
[not found] ` <CAO_nJAYWQWrWaQVfUmVpJGFtOeKKE76im-AkLUDTJm8DN4VAgA@mail.gmail.com>
[not found] ` <2292eb8d-8357-227f-5448-d1d03b33c042@huawei.com>
2020-03-25 13:58 ` John
2020-03-25 15:28 ` Jaegeuk Kim [this message]
2020-03-25 18:41 ` John
2020-03-25 19:04 ` John
2020-03-25 19:59 ` Jaegeuk Kim
2020-03-25 21:13 ` John
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200325152859.GA65658@google.com \
--to=jaegeuk@kernel.org \
--cc=graysky@archlinux.us \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.