Date: Thu, 5 Sep 2013 20:50:52 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255265 - head/sbin/swapon Message-ID: <201309052050.r85KoqIx000926@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hrs Date: Thu Sep 5 20:50:52 2013 New Revision: 255265 URL: http://svnweb.freebsd.org/changeset/base/255265 Log: 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 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Thu Sep 5 20:34:58 2013 (r255264) +++ head/sbin/swapon/swapon.c Thu Sep 5 20:50:52 2013 (r255265) @@ -170,13 +170,20 @@ main(int argc, char **argv) if (which_prog == SWAPON || which_prog == SWAPOFF) { if (doall) { while ((fsp = getfsent()) != NULL) { - if (strcmp(fsp->fs_type, FSTAB_SW)) + if (strcmp(fsp->fs_type, FSTAB_SW) != 0) continue; - if (strstr(fsp->fs_mntops, "noauto")) + if (strstr(fsp->fs_mntops, "noauto") != NULL) 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 && - strstr(fsp->fs_mntops, "late") && - !late) + (strstr(fsp->fs_mntops, "late") != NULL || + strstr(fsp->fs_mntops, "file=") != NULL) && + late == 0) continue; swfile = swap_on_off(fsp->fs_spec, 1, fsp->fs_mntops);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309052050.r85KoqIx000926>