aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-11-29 19:11:33 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-12-03 08:42:21 +0000
commita5c2d59ed3d6365c26322f3e100467454774b501 (patch)
treefc7e22d205435585130032df9c3c26af8fa7f444
parent24e365220007c415f495cf8dcb228ece6002b8b7 (diff)
Expand comment explaining reasons for automatic swapoff on shutdown
Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33167
-rw-r--r--sys/kern/vfs_bio.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 61fe9a6e2bfd..acd16ecdf3fe 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1458,9 +1458,16 @@ bufshutdown(int show_busybufs)
printf("Final sync complete\n");
/*
- * Unmount filesystems. Swapoff before unmount,
- * because file-backed swap is non-operational after unmount
- * of the underlying filesystem.
+ * Unmount filesystems and perform swapoff, to quiesce
+ * the system as much as possible. In particular, no
+ * I/O should be initiated from top levels since it
+ * might be abruptly terminated by reset, or otherwise
+ * erronously handled because other parts of the
+ * system are disabled.
+ *
+ * Swapoff before unmount, because file-backed swap is
+ * non-operational after unmount of the underlying
+ * filesystem.
*/
if (!KERNEL_PANICKED()) {
swapoff_all();