]>
git.ipfire.org Git - thirdparty/util-linux.git/commit - sys-utils/swapon.c
swapon: fix discard option parsing
The current code does not work as expected if there is an option
behind the discard=<arg>, for example:
swapon /dev/sdc -o discard=once,pri=10
ignores "once" the result is SWAP_FLAG_DISCARD; strace:
Old version:
swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|10) = 0
Fixed version:
swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE|10) = 0
Signed-off-by: Karel Zak <kzak@redhat.com>