On 03/23, John wrote:
> On Mon, Mar 23, 2020 at 12:11 AM Jaegeuk Kim <jaeg...@kernel.org> wrote:
> >
> > On 03/18, John wrote:
> > > On Mon, Mar 16, 2020 at 9:44 PM Chao Yu <yuch...@huawei.com> wrote:
> > > >
> > > > On 2020/3/16 17:52, John wrote:
> > > > > On Sun, Mar 15, 2020 at 9:24 PM Chao Yu <yuch...@huawei.com> wrote:
> > > > >>
> > > > >> What's your mount option and mkfs option on those two partitions, 
> > > > >> and what's
> > > > >> your kernel version?
> > > > >
> > > > > I am mounting the partitions with systemd like so (/etc/fstab entry):
> > > > >   LABEL=incoming         /incoming     f2fs  
> > > > > noauto,x-systemd.automount  0 0
> > > > >
> > > > > But I can reproduce this if I totally remove the entries within
> > > > > /etc/fstab, reboot, and mount manually like this:
> > > > >   mount LABEL=incoming /incoming
> > > >
> > > > However, the directory where you trigger trim is "/mnt/media"?
> > > >
> > > > Quoted:
> > > > "Invoking it manually on the newer one gives this:
> > > > # fstrim -v /mnt/media
> > > > fstrim: /mnt/media: the discard operation is not supported"
> >
> > Hmm, could you share cat /proc/mounts?
> 
> Since I posted, I have completely reformatted the Samsung 860 EVO 2TB.
> Now, it is just a single LUKS partition with f2fs.  I am getting the
> same "fstrim: /mnt/media: the discard operation is not supported"
> error when I try using fstrim -v /mnt/media with it.
> 
> Here is cat /proc/mounts, thank you for the consideration:
> proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
> sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
> dev /dev devtmpfs rw,nosuid,relatime,size=3903292k,nr_inodes=975823,mode=755 
> 0 0
> run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
> efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 > 0
> /dev/sda2 / ext4 rw,relatime 0 0
> securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
> tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
> devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 
> 0 0
> tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
> cgroup2 /sys/fs/cgroup/unified cgroup2
> rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
> cgroup /sys/fs/cgroup/systemd cgroup
> rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
> pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
> none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
> cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
> cgroup /sys/fs/cgroup/perf_event cgroup
> rw,nosuid,nodev,noexec,relatime,perf_event 0 0
> cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 
> 0 0
> cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 
> 0 0
> cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
> cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
> cgroup /sys/fs/cgroup/cpu,cpuacct cgroup
> rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
> cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
> cgroup /sys/fs/cgroup/net_cls,net_prio cgroup
> rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
> cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 
> 0 0
> cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
> systemd-1 /proc/sys/fs/binfmt_misc autofs
> rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12920
> 0 0
> hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
> mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
> debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
> tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
> tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
> configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
> systemd-1 /mnt/media autofs
> rw,relatime,fd=49,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14523
> 0 0
> tmpfs /scratch tmpfs rw,lazytime,nodev,relatime,size=6291456k 0 0
> nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
> /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?

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.

> 0 0
> /dev/mapper/media-crypt /srv/nfs/share f2fs
> ro,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
> 0 0
> sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
> tmpfs /run/user/1000 tmpfs
> rw,nosuid,nodev,relatime,size=782676k,mode=700,uid=1000,gid=100 0 0


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

Reply via email to