From nobody Mon Dec 06 00:30:09 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A034D18C280F; Mon, 6 Dec 2021 00:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J6kpp0xqlz4ZXS; Mon, 6 Dec 2021 00:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA29921BA5; Mon, 6 Dec 2021 00:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B60U9qr088532; Mon, 6 Dec 2021 00:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B60U9Zg088529; Mon, 6 Dec 2021 00:30:09 GMT (envelope-from git) Date: Mon, 6 Dec 2021 00:30:09 GMT Message-Id: <202112060030.1B60U9Zg088529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c1abd6bd3d99 - stable/13 - shutdown: unmount filesystems after swapoff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1abd6bd3d998b30b705d2593eef0b3ac90ce7b8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638750610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lT7kHRNUwHakoDS3EFXrrjQfy5ktiB71FbEXMH2j5kQ=; b=ryr/0fcWqpJJ9dL+bjDdeidjvlzPSuHDYsetlLKxeiHnr7VzjZtfWqwJlRTE/grlDX1Nrq 38HeBRC9IYSRXfnrBBDQdAEgJidNnqEs5SUZ6+0B9cd/d1MDNsF2vnfxfpwdoQNjK99DZT DZXKtgrt82rErIJDCJYX9KxjgCdsM0i5i3LSo0lDm+QOTyJEUsBT6RanFxh3HGgFZyQGi8 wKTd7NOURse2r3e+w4jne4yBIg7vvM28DigKMHJmHcXT0jy+JkJFnN5bOEYVUviwnUJ7Ac +ffcCYG/p2SKnkYCcIj/4qL3sVe0eNcf4cVYpaNGl10qMWmPDMhfna5tX5f+WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638750610; a=rsa-sha256; cv=none; b=E/IOXp3B99mpXMTeXAL/BDynHE5g0z/NYWpJAx17dcacu7q8XRyn3CeN7RTcXMvH3G5rA2 ixYyAqXyxdpII5KKjuD9mE4tTxp+avx8of6wl94WZ3Snf6mmQa+3lp4V/bi5sI4MH4TzIG dlSeSsH/eNNO5tJ6LHTEvRnbs6eaLTjT4eFBI51WXcWOoIbZ7sv+tTb2Va9nH2254o1EPW c4IbojkdZ0+AvR263IXbMEGTz4IT0u0fX+hUcjquV1YvkJHVfPkxjxDbhdeOt9wmnpLEAu ERgd4ph4cE5SrrMqlhQxs1EWs147JBQ76RiUFbzIwN/Ona9T3H4HW7XIs/qV/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c1abd6bd3d998b30b705d2593eef0b3ac90ce7b8 commit c1abd6bd3d998b30b705d2593eef0b3ac90ce7b8 Author: Konstantin Belousov AuthorDate: 2021-11-28 01:52:46 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-06 00:29:43 +0000 shutdown: unmount filesystems after swapoff (cherry picked from commit 08bb51f8d60c552d1f7c202cc2eb267ed480e541) --- sys/kern/vfs_bio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index eb3dd9ff6038..511bcb746a00 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1443,16 +1443,21 @@ bufshutdown(int show_busybufs) */ printf("Giving up on %d buffers\n", nbusy); DELAY(5000000); /* 5 seconds */ + swapoff_all(); } else { if (!first_buf_printf) printf("Final sync complete\n"); + /* - * Unmount filesystems + * Unmount filesystems. Swapoff before unmount, + * because file-backed swap is non-operational after unmount + * of the underlying filesystem. */ - if (!KERNEL_PANICKED()) + if (!KERNEL_PANICKED()) { + swapoff_all(); vfs_unmountall(); + } } - swapoff_all(); DELAY(100000); /* wait for console output to finish */ }