Subject: Re: README: changes to config, to support dump device configuration
To: Jonathan Stone <firstname.lastname@example.org>
From: Jason Thorpe <email@example.com>
Date: 06/14/1997 17:46:27
On Sat, 14 Jun 1997 17:16:52 -0700
Jonathan Stone <jonathan@DSG.Stanford.EDU> wrote:
> Does the kernel _really_ do a coredump dump on a b partition,
> regardless of the partition type in the disklabel?
> Since swap is now optional, reserving b partitions for swap is
> presumably optional. Therefore reserving B partitions for _dumps_
> (which is, historically, just a side-effect of them being swap
> devices) should be optional too.
> I think it'd be safer and more correct to only do wildcarded dumps
> onto B partitions that are labelled as type `swap'.
...take a look at the code, and you'll find the following, in
various ports' cpu_dumpconf()s...
if (bdevsw[maj].d_psize == NULL)
nblks = (*bdevsw[maj].d_psize)(dumpdev);
if (nblks <= ctod(1))
...and, in e.g. sdsize():
struct sd_softc *sd;
if (sdopen(dev, 0, S_IFBLK, NULL) != 0)
sd = sd_cd.cd_devs[SDUNIT(dev)];
part = SDPART(dev);
if (sd->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP)
size = -1;
size = sd->sc_dk.dk_label->d_partitions[part].p_size;
if (sdclose(dev, 0, S_IFBLK, NULL) != 0)
I.e. it's not a problem.
The disk driver is the appropriate place to check the partition type,
since it has the label first-hand.
Jason R. Thorpe firstname.lastname@example.org
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939