mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Enable "late" option when a file= option is specified in /etc/fstab.
The file= option requires rw mount where the backing store exists but it does not work because rc.d/swap runs before rc.d/fsck. Reported by: wblock
This commit is contained in:
parent
79e6a2c01e
commit
4139627db6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255265
|
@ -170,13 +170,20 @@ main(int argc, char **argv)
|
||||||
if (which_prog == SWAPON || which_prog == SWAPOFF) {
|
if (which_prog == SWAPON || which_prog == SWAPOFF) {
|
||||||
if (doall) {
|
if (doall) {
|
||||||
while ((fsp = getfsent()) != NULL) {
|
while ((fsp = getfsent()) != NULL) {
|
||||||
if (strcmp(fsp->fs_type, FSTAB_SW))
|
if (strcmp(fsp->fs_type, FSTAB_SW) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (strstr(fsp->fs_mntops, "noauto"))
|
if (strstr(fsp->fs_mntops, "noauto") != NULL)
|
||||||
continue;
|
continue;
|
||||||
|
/*
|
||||||
|
* Forcibly enable "late" option when file= is
|
||||||
|
* specified. This is because mounting file
|
||||||
|
* systems with rw option is typically
|
||||||
|
* required to make the backing store ready.
|
||||||
|
*/
|
||||||
if (which_prog != SWAPOFF &&
|
if (which_prog != SWAPOFF &&
|
||||||
strstr(fsp->fs_mntops, "late") &&
|
(strstr(fsp->fs_mntops, "late") != NULL ||
|
||||||
!late)
|
strstr(fsp->fs_mntops, "file=") != NULL) &&
|
||||||
|
late == 0)
|
||||||
continue;
|
continue;
|
||||||
swfile = swap_on_off(fsp->fs_spec, 1,
|
swfile = swap_on_off(fsp->fs_spec, 1,
|
||||||
fsp->fs_mntops);
|
fsp->fs_mntops);
|
||||||
|
|
Loading…
Reference in a new issue