Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 1999 13:00:24 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bright@rush.net, current@FreeBSD.ORG
Subject:   Re: nodump is not a dump routine.
Message-ID:  <199905190300.NAA31984@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>i'm wondering why when the system dumpdev is set to a device that 
>doesn't have a read dump routine (nodump()) why it lies about the
>dump being successful.

Just another bug.

>Index: kern_shutdown.c
>===================================================================
>RCS file: /home/ncvs/src/sys/kern/kern_shutdown.c,v
>retrieving revision 1.52
>diff -u -r1.52 kern_shutdown.c
>--- kern_shutdown.c	1999/05/12 22:30:46	1.52
>+++ kern_shutdown.c	1999/05/19 00:38:43
>@@ -387,6 +387,10 @@
> 	printf("dump ");
> 	switch ((*bdevsw(dumpdev)->d_dump)(dumpdev)) {
> 
>+	case ENODEV:
>+		printf("device has no dump routine\n");
>+		break;
>+

Also, the default case should print "failed", and only the 0 case
should print "succeeded".

>shouldn't 
>src/sys/i386/i386/autoconf.c, and
>src/sys/alpha/alpha/autoconf.c decline to set the dump device
>to a device that has nodump() as its dump routine?

setdumpdev() probably shouldn't know so much about the dump routine.
The driver can easily have a routine that fails when it is actually
called for reasons that setdumpdev() can't know.  Perhaps nodump
should be simply ((d_dump_t)NULL).  dumpsys() already checks for a
null d_dump pointer before calling it, although setdumpdev() doesn't.

>one other question, considering the newbus stuff, shouldn't
>there be a way to get the text string of the dump device somehow
>so "dumpon" with no arguments can print out the current value
>without scanning /dev for a device that matches it?

This was broken by "newsysctl", not by newbus.  In Lite1, the CONSDEV
sysctl is specially handled and the device number is converted to a name
using devname(3).  Newsysctl neglects to convert to a name, and can't in
general, since it has no way of knowing if the device is a cdev or a bdev.

devname() is also broken.  ISTR it has some fundamental problems, and it
now returns NULL instead of the documented "??" when it can't determine
the device name.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905190300.NAA31984>