Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Dec 2002 15:19:12 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Nate Lawson <nate@root.org>
Cc:        Julian Elischer <julian@FreeBSD.org>, cvs-all@freebsd.org, cvs-committers@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/i386 dump_machdep.c
Message-ID:  <Pine.BSF.4.21.0212161516260.11938-100000@InterJet.elischer.org>
In-Reply-To: <Pine.BSF.4.21.0212161505500.47122-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 16 Dec 2002, Nate Lawson wrote:

> On Mon, 16 Dec 2002, Julian Elischer wrote:
> >   Modified files:
> >     sys/i386/i386        dump_machdep.c 
> >   Log:
> >   Don't dump core into a partition that is too small for it.
> >   If we do, we usually wrote backwareds into the proceeding partititon
> >   which is usually the root partition.
> > [..]
> > @@ -75,6 +75,15 @@
> >  		strncpy(kdh.panicstring, panicstr, sizeof kdh.panicstring);
> >  	kdh.parity = kerneldump_parity(&kdh);
> >  
> > +	if (di->mediasize <  
> > +	    ((Maxmem * (off_t)PAGE_SIZE) +	/* Memory to save */
> > +	    (sizeof kdh * 2) +			/* header + trailer */
> > +	    (64*1024)))	{			/* Room to leave untouched */
> > +						/* at partition head. */
> > +						/* (an arbitrary amount). */
> > +		printf("\nDump failed. Partition too small.\n");
> > +		return;
> > +	}
> >  	dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE;
> >  	dumplo -= sizeof kdh * 2;
> >  	i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh);
> 
> Heh, it seems you went even farther to tweak everyone that had style(9)
> complaints with the proposal.  At the very least, PLEASE move the comment
> to before the line.
> 
> Functionally, it is important that this check be MI.

I thought about that.
Different architectures can have different dump sizes (theoretically)
so only the MD code can know how much room it needs.
For example, ia64 might decide to implement sparse dumps.

> 
> -Nate
> 
> 


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0212161516260.11938-100000>