Bug #3207
closedswapon fails silently when trim option is given
100%
Description
In /etc/fstab I have the following line:
/dev/serno/xxx.s1b none swap sw,crypt,trim 0 0
When I startup, "swapctl -l" does not list any devices.
If I remove the "trim" option above, it works and "swapctl -l"
shows the configured device.
The disk is a Samsung SSD 960 PRO using the nvme driver.
Having no swap configured silently might not be the best option.
Updated by deef over 4 years ago
If I read the code correctly, given device is first turned into a crypted volume, then "trim" operation is performed on the volume, and only when this succeeds, swapon() is called actually.
The problem may be that calling ioctl() with DAIOCTRIM argument on a crypted volume just fails. If that's the case, an error message "Device trim failed" should be displayed, followed by usage() which ends with exit(1).
Updated by deef over 4 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Fixed in commit eeecdae6+. Thank you for reporting this.