diff options
author | bde <bde@FreeBSD.org> | 1998-05-12 17:34:02 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-05-12 17:34:02 +0000 |
commit | 53cc68b7439b8c23ef848267d002d17287b6f4f9 (patch) | |
tree | 6784cd36f7ec68fca765252352493bc5d5c3f6ef /sys/kern/kern_shutdown.c | |
parent | 8001efd4061597254a2d193588dcd02ee0574d07 (diff) | |
download | FreeBSD-src-53cc68b7439b8c23ef848267d002d17287b6f4f9.zip FreeBSD-src-53cc68b7439b8c23ef848267d002d17287b6f4f9.tar.gz |
Backed out previous commit. It is invalid to call d_ioctl() on
possibly non-open devices, and we don't want to restrict dumping
to swap devices anwyay. It is especially invalid to call d_ioctl()
in non-process context for panics. d_psize() can be called on
non-open devices, at least on non-SLICED ones that support d_dump(),
and setdumpdev() has depended on this for a long time although it
is probably wrong, but even d_psize() can't be called in non-process
context - that's why dumpsys() depends on previously computed values
although these values may be stale. The historical restriction to
devices with dkpart(dev) == SWAP_PART should go away.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 40704d8..448bcc0 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_shutdown.c,v 1.29 1998/03/08 09:56:54 julian Exp $ + * $Id: kern_shutdown.c,v 1.30 1998/05/06 22:14:48 julian Exp $ */ #include "opt_ddb.h" @@ -55,7 +55,6 @@ #include <sys/sysctl.h> #include <sys/conf.h> #include <sys/sysproto.h> -#include <sys/disklabel.h> #include <machine/pcb.h> #include <machine/clock.h> @@ -359,21 +358,17 @@ SYSINIT(dump_conf, SI_SUB_DUMP_CONF, SI_ORDER_FIRST, dump_conf, NULL) static void dumpsys(void) { - struct partinfo pi; if (!dodump) return; if (dumpdev == NODEV) return; + if ((minor(dumpdev)&07) != 1) + return; if (!(bdevsw[major(dumpdev)])) return; if (!(bdevsw[major(dumpdev)]->d_dump)) return; - if ((*bdevsw[major(dumpdev)]->d_ioctl)(dumpdev, DIOCGPART, - (caddr_t)&pi, 0, NULL)) - return; - if (pi.part->p_fstype != FS_SWAP) - return; dumpsize = Maxmem; printf("\ndumping to dev %lx, offset %ld\n", dumpdev, dumplo); printf("dump "); |