summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-12-11 05:27:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-12-11 05:27:41 +0000
commitd1538d110d9557ee9f9e4b04b6cba258e4f43d3a (patch)
treefd0c509c4d351be908d5ccc6ae3ffd4b0a61c6a5 /sys/arch
parent2921b422210353885272232bc38314523b006e06 (diff)
In uvm Chuck decided backing store would not be allocated proactively
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/machdep.c4
-rw-r--r--sys/arch/amd64/amd64/machdep.c4
-rw-r--r--sys/arch/arm/arm/arm32_machdep.c4
-rw-r--r--sys/arch/arm64/arm64/machdep.c4
-rw-r--r--sys/arch/hppa/hppa/machdep.c4
-rw-r--r--sys/arch/i386/i386/machdep.c4
-rw-r--r--sys/arch/landisk/landisk/machdep.c4
-rw-r--r--sys/arch/loongson/loongson/machdep.c4
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c4
-rw-r--r--sys/arch/macppc/macppc/machdep.c4
-rw-r--r--sys/arch/octeon/octeon/machdep.c4
-rw-r--r--sys/arch/sgi/sgi/machdep.c4
-rw-r--r--sys/arch/socppc/socppc/machdep.c4
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c4
14 files changed, 28 insertions, 28 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index 57c7d0f2721..b17a184ec4a 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.181 2017/05/29 14:19:49 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.182 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
@@ -977,7 +977,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index a5011d72f32..33bef001d4f 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.235 2017/10/27 06:48:13 yasuoka Exp $ */
+/* $OpenBSD: machdep.c,v 1.236 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -725,7 +725,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/arm/arm/arm32_machdep.c b/sys/arch/arm/arm/arm32_machdep.c
index 2eb86cded27..f528dc49997 100644
--- a/sys/arch/arm/arm/arm32_machdep.c
+++ b/sys/arch/arm/arm/arm32_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arm32_machdep.c,v 1.54 2017/08/12 13:18:48 tedu Exp $ */
+/* $OpenBSD: arm32_machdep.c,v 1.55 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: arm32_machdep.c,v 1.42 2003/12/30 12:33:15 pk Exp $ */
/*
@@ -206,7 +206,7 @@ bootsync(int howto)
printf("Warning IRQ's disabled during boot()\n");
}
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/arm64/arm64/machdep.c b/sys/arch/arm64/arm64/machdep.c
index db259e9c265..d1d5a673849 100644
--- a/sys/arch/arm64/arm64/machdep.c
+++ b/sys/arch/arm64/arm64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.22 2017/09/08 05:36:51 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.23 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
*
@@ -336,7 +336,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 3a1f4888238..9247b5d28d1 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.248 2017/05/18 15:41:59 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.249 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -902,7 +902,7 @@ boot(int howto)
if ((howto & RB_NOSYNC) == 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 91ba126fef0..89ac87cc4a5 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.606 2017/09/03 07:00:53 mlarkin Exp $ */
+/* $OpenBSD: machdep.c,v 1.607 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2641,7 +2641,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/landisk/landisk/machdep.c b/sys/arch/landisk/landisk/machdep.c
index b4baca5c86a..9df9c4ee79a 100644
--- a/sys/arch/landisk/landisk/machdep.c
+++ b/sys/arch/landisk/landisk/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.45 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.46 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*-
@@ -202,7 +202,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0) {
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index 74aeb1a6da3..2e797fcba9d 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.80 2017/08/26 13:53:46 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.81 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -1061,7 +1061,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index 65884df7195..89bc6e4d497 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.126 2017/11/03 09:07:54 aoyama Exp $ */
+/* $OpenBSD: machdep.c,v 1.127 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -429,7 +429,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0) {
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 18ed83f1a52..6aaae3cb1cb 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.181 2017/06/13 01:42:12 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.182 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -743,7 +743,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && !syncing) {
syncing = 1;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index 433ff9ec2ca..6b7f5bc916d 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.101 2017/11/01 14:43:01 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.102 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -760,7 +760,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index db43e7bbf15..295c0fc6ee1 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.156 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.157 2017/12/11 05:27:40 deraadt Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -835,7 +835,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c
index 0e149caebd3..bf0b0228074 100644
--- a/sys/arch/socppc/socppc/machdep.c
+++ b/sys/arch/socppc/socppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.72 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.73 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -658,7 +658,7 @@ boot(int howto)
boothowto = howto;
if ((howto & RB_NOSYNC) == 0 && !syncing) {
syncing = 1;
- vfs_shutdown();
+ vfs_shutdown(curproc);
if ((howto & RB_TIMEBAD) == 0) {
resettodr();
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 94fc8cd25a8..e369e96ad2f 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.185 2017/10/23 18:38:33 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.186 2017/12/11 05:27:40 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -626,7 +626,7 @@ boot(int howto)
extern int sparc_clock_time_is_ok;
waittime = 0;
- vfs_shutdown();
+ vfs_shutdown(curproc);
/*
* XXX