diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2017-03-28 10:43:19 +0000 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2017-03-28 10:43:19 +0000 |
commit | 0c363d8f2ca274dcb7c09fa3e2158df5d9319985 (patch) | |
tree | b4800252f3aea0ddb5ec1986a1e858b853c51abd /sbin/swapon | |
parent | b2a909df5ca85be2d2920d3b1d09ca037e1014fb (diff) | |
download | FreeBSD-src-0c363d8f2ca274dcb7c09fa3e2158df5d9319985.zip FreeBSD-src-0c363d8f2ca274dcb7c09fa3e2158df5d9319985.tar.gz |
MFC r315242: 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
Differential Revision: D9835
Diffstat (limited to 'sbin/swapon')
-rw-r--r-- | sbin/swapon/swapon.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index 052fbc7..6ec2ff1 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -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); |