On 2020/3/24 4:12, John wrote:
> On Mon, Mar 23, 2020 at 11:02 AM Jaegeuk Kim <jaeg...@kernel.org> wrote:
>>> /dev/mapper/media-crypt /mnt/media f2fs
>>> rw,lazytime,relatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix
>>
>> - media-crypt means dm-crypt? Any chance to try raw sda?
> 
> Yes, it is dm-crypt.
> 
>> Could you try this?
>> - mount -o remount,nodiscard
>>  : The reason is, as f2fs uses async discard feature with -o discard, it 
>> doesn't
>>    give 0 bytes on fstrim sometimes.
> 
> I can confirm it is mounted now with the nodiscard option, but fstrim
> still claims discard is not supported.

Can you try below command and show us the result to see whether device supports 
discard:

strace blkdiscard -o 0 -l 4096 /dev/mapper/media-crypt

It may discard first 4k block which is first superblock of f2fs, for safety, it 
will
be better to backup all your data before executing the command.

Thanks,

> 
> % mount | grep crypt
> /dev/mapper/media-crypt on /mnt/media type f2fs
> (rw,relatime,lazytime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix,x-systemd.automount)
> 
> # fstrim -v /mnt/media
> fstrim: /mnt/media: the discard operation is not supported
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to