Fix late and noauto with geli swap

With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by:	jilles
Approved by:	jilles
MFC after:	2 weeks
Differential Revision:	D9835
This commit is contained in:
Dmitry Marakasov 2017-03-14 12:39:19 +00:00
parent 01feb4c3d4
commit 8d27c2000b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315242

View File

@ -375,8 +375,12 @@ swap_on_geli_args(const char *mntops)
free(ops);
return (NULL);
}
} else if ((p = strstr(token, "notrim")) == token) {
} else if (strcmp(token, "notrim") == 0) {
Tflag = " -T ";
} else if (strcmp(token, "late") == 0) {
/* ignore known option */
} else if (strcmp(token, "noauto") == 0) {
/* ignore known option */
} else if (strcmp(token, "sw") != 0) {
warnx("Invalid option: %s", token);
free(ops);