From owner-freebsd-bugs Sun Oct 12 16:55:39 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA29141 for bugs-outgoing; Sun, 12 Oct 1997 16:55:39 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA29134 for ; Sun, 12 Oct 1997 16:55:36 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id JAA13707; Mon, 13 Oct 1997 09:54:49 +1000 Date: Mon, 13 Oct 1997 09:54:49 +1000 From: Bruce Evans Message-Id: <199710122354.JAA13707@godzilla.zeta.org.au> To: j@uriah.heep.sax.de, volf@oasis.IAEhv.nl Subject: Re: bin/4303 Cc: freebsd-bugs@FreeBSD.ORG Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> I completely disagree: if I set dumpon to a non swap device by accident, >> (for example /dev/rsd0s1e) I could/will lose part of my file system. > >dumpon should perhaps issue a warning if the device looks like >something that has a filesystem on it. It should refuse to dump to dumpon should do what it is told. It is less dangerous than swapon. >any device that was opened by the time the dump happens. Then it would be impossible to dump to (active) swap devices. Swap devices are not closed on shutdown (this is a bug - it leaves media locked). >> But that is not the point. In kern_shutdown.c the following code can be >> found (arround line 320 in function dumpsys): >> >> if ((minor(dumpdev)&07) != 1) >> return; > >This used to be an (undocumented) feature, but turned into a bug over >time. A device with (minor & 07) == 1 is no longer something very >special. Swapping could have happened to anything else, nor would it >make much sense that you could dump to /dev/rfd0.1720 but not to any >other floppy device. ;-) Let alone tape drives... No, such devices are very special, although swap devices are not. Someone broke the minor numbering convention for floppies and and cdroms, but drivers for these disk devices and all tape devices won't have a dump routine, so dumpon on them will fail. The bugs are: - the above check is not performed in the sysctl to set the dump device, so dumpon can succeed although the dump device is unusable. - the above check is not compatible with the checking for swap devices. - the (partition for) the dump device may change after the dump device is if the media is removable or the device containing the partition is repartitioned. Thus most of the checking done in the sysctl is not final, and the wrong device may be written to at dump time. The (minor & 07) check is useful for preventing problems here - just follow the convention that the 'b' partition is always for disposable data. Bruce