From owner-svn-src-all@freebsd.org Sat Nov 19 20:02:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D79D3C4BAC5; Sat, 19 Nov 2016 20:02:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 902478F6; Sat, 19 Nov 2016 20:02:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAJK2n9i054417; Sat, 19 Nov 2016 20:02:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAJK2nrx054412; Sat, 19 Nov 2016 20:02:49 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201611192002.uAJK2nrx054412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 19 Nov 2016 20:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r308865 - in stable/11: etc/rc.d sbin/swapon X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2016 20:02:51 -0000 Author: jilles Date: Sat Nov 19 20:02:49 2016 New Revision: 308865 URL: https://svnweb.freebsd.org/changeset/base/308865 Log: MFC r307755: swapoff: Remove only late devices with -aL. Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be very slow and may not even be possible if there is a lot of swap space in use. However, removing swap devices is only needed for late swap devices that may depend on daemons that subsequent shutdown steps stop. Normal swap devices such as hard disk partitions will remain available throughout the shutdown process and need not be removed. In swapoff, interpret -aL to remove late swap devices only, and use this in etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all swap devices, both normal and late). PR: 187081 Modified: stable/11/etc/rc.d/swaplate stable/11/sbin/swapon/swapon.8 stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/swaplate ============================================================================== --- stable/11/etc/rc.d/swaplate Sat Nov 19 19:59:28 2016 (r308864) +++ stable/11/etc/rc.d/swaplate Sat Nov 19 20:02:49 2016 (r308865) @@ -12,7 +12,7 @@ name="swaplate" desc="Setup late swap space" start_cmd='/sbin/swapon -aLq' -stop_cmd='/sbin/swapoff -aq' +stop_cmd='/sbin/swapoff -aLq' load_rc_config swap run_rc_command "$1" Modified: stable/11/sbin/swapon/swapon.8 ============================================================================== --- stable/11/sbin/swapon/swapon.8 Sat Nov 19 19:59:28 2016 (r308864) +++ stable/11/sbin/swapon/swapon.8 Sat Nov 19 20:02:49 2016 (r308865) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 2, 2016 +.Dd October 21, 2016 .Dt SWAPON 8 .Os .Sh NAME @@ -98,6 +98,12 @@ will be removed, unless their .Dq noauto option is also set. If the +.Fl L +option is specified, +only swap devices with the +.Dq late +option will be removed. +If the .Fl q option is used, informational messages will not be Modified: stable/11/sbin/swapon/swapon.c ============================================================================== --- stable/11/sbin/swapon/swapon.c Sat Nov 19 19:59:28 2016 (r308864) +++ stable/11/sbin/swapon/swapon.c Sat Nov 19 20:02:49 2016 (r308865) @@ -176,6 +176,10 @@ main(int argc, char **argv) strstr(fsp->fs_mntops, "late") && late == 0) continue; + if (which_prog == SWAPOFF && + strstr(fsp->fs_mntops, "late") == NULL && + late != 0) + continue; swfile = swap_on_off(fsp->fs_spec, 1, fsp->fs_mntops); if (swfile == NULL) {