[fstools, 0/4] Support discard in "block" and "swapon"
Maxim Storchak
m.storchak at gmail.com
Tue Mar 17 04:23:08 PDT 2026
Hello,
23.07.25 16:19, m.storchak at gmail.com:
> From: Maxim Storchak <m.storchak at gmail.com>
>
> This patch series adds the "discard" option to block by extending the swap
> entries of fstab config with the discard parameter that provides full control
> over the discard feature.
>
> swapon is another entry point for swap activation, so it gets an extra flag -d.
>
> The implementation is inspired by busybox.
>
I've been runninng with these patches applied since the post time, with
no issues.
[ 28.419614] Adding 204796k swap on /dev/dm-3. Priority:-2 extents:1
across:204796k SSDsc
swapon on a rotational drive ignores the discard flag:
# swapon -d /dev/vg0/swap1
# echo $?
0
# dmesg | grep 'Adding.*swap' | tail -n1
[610560.700332] Adding 102396k swap on /dev/vg0/swap1. Priority:-3
extents:1 across:102396k
Is there any chance to get them reviewed and applied?
More information about the openwrt-devel
mailing list