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 12:59:19 -0700 [thread overview]
Message-ID: <20200325195919.GA200530@google.com> (raw)
In-Reply-To: <CAO_nJAbKHvD5YJ=PLv=Dbfi2xD6N7XX6LV7TAraKSaZ1MOx81A@mail.gmail.com>
On 03/25, John wrote:
> On Wed, Mar 25, 2020 at 2:41 PM John wrote:
> > I can confirm that it is true with an encrypted ext4 partition. I get
> > the same error, "fstrim: /mnt/test: the discard operation is not
> > supported" when I try it there on the same device. Unless there is a
> > good reason for it, not having discard on LUKS encrypted partitions
> > seems like a pretty serious omission. Perhaps it is intentional.
>
> I see now from searching that this is by design,
> https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives_(SSD)
>
> I added the "discard" option to the entry in /etc/crypttab and
> rebooted. I am now able to get a successful run of fstrim on this F2FS
> partition:
>
> # fstrim -v /mnt/media
> /mnt/media: 0 B (0 bytes) trimmed
>
> Is it normal to return 0 bytes trimmed for F2FS partitions? By
It's normal, and that's why I asked -o nodiscard. The reason is F2FS creates
asynchronous discard thread to alleviate long discarding latency among RW IOs.
It keeps candidates in memory, and the thread issues them in idle time.
In that mode, when you do fstrim, F2FS collects all the discard candidates given
address space, and returns zero, since it didn't issue any discard command at
the moment.
But, if you set -o nodiscard, you can see the actual trimmed size, since F2FS
disabled the async discard thread and issue discard rightaway if device supports
it.
> contrast, if I go to my test SSD, create a LUKS partition, open it
> with the --allow-discards option to cryptsetup, format it to ext4,
> mount that and then run fstrim on it, I am getting non-0 values for
> fstrim when I run it:
>
> # fstrim -v /mnt/test_crypt_ext4
> /mnt/test_crypt_ext4: 3.9 GiB (4123463680 bytes) trimmed
>
> So I think something still isn't quite right with F2FS over crypto_LUKS.
>
> Thanks for the help!
_______________________________________________
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 19:59 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
2020-03-25 18:41 ` John
2020-03-25 19:04 ` John
2020-03-25 19:59 ` Jaegeuk Kim [this message]
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=20200325195919.GA200530@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).