From owner-freebsd-current Fri Dec 13 17:10:14 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B1C337B401; Fri, 13 Dec 2002 17:10:12 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77F9743ED1; Fri, 13 Dec 2002 17:10:11 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2002121401100900100puac8e>; Sat, 14 Dec 2002 01:10:10 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA12336; Fri, 13 Dec 2002 17:07:24 -0800 (PST) Date: Fri, 13 Dec 2002 17:07:22 -0800 (PST) From: Julian Elischer To: Peter Wemm Cc: Dan Nelson , Nate Lawson , Kevin Oberman , FreeBSD current users , re@freebsd.org Subject: Re: 5.0 showstopper In-Reply-To: <20021214004513.733AB2A7EA@canning.wemm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 13 Dec 2002, Peter Wemm wrote: > Julian Elischer wrote: > > On Fri, 13 Dec 2002, Julian Elischer wrote: > > > On Fri, 13 Dec 2002, Dan Nelson wrote: > > > > > > > In the last episode (Dec 13), Julian Elischer said: > > > > > It's always been there. the question is > > > > > "Who has broken it?" > > > > > > I think this is a 5.0 showstopper. Having 5.0 overwrite your > > > Windows partition would be "poor" PR. > > > Having a quick look at it, it shouldn't be too hard for PHK > > > to fix it as he has all the correct parts currently "loaded" > > > into his head. Especially such things as making GEOM not allow writes > > > to -ve blocknumbers (as must have happenned for root to have been > > > overwritten). > > > > > > looking at the code in src/sys/i386/i386/dump_machdep.c, > > > > we see: > > 78 dumplo = di->mediaoffset + di->mediasize - Maxmem * > > (off_t)PAGE_SIZE; > > 79 dumplo -= sizeof kdh * 2; > > 80 i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh); > > 81 if (i) > > 82 printf("\nDump failed writing header (%d)\n", i); > > 83 dumplo += sizeof kdh; > > 84 i = 0; > > > > It looks like the following test should go after line 77 > > > > if (di->mediasize < ((Maxmem * (off_t)PAGE_SIZE) + > > (sizeof kdh * 2) + (16*1024)) { > > /* 16K is an arbitrary buffer > > * in case the swap part is > > * the first part > > */ > > printf("\nDump failed. Partition too small.\n"); > > return; > > } > > We used to force a 64K safety buffer for swapon, and I think we also did > 64K for dump before the last MI dump code conversion. I'd feel a little > happier if you used 64K here instead of 16K. Actually I think we could put this in the MI code.... somewhat like as follows: src/sys/kern/kern_shutdown.c 228 static void 229 doadump(void) 230 { 231 savectx(&dumppcb); 232 dumping++; > > if (dumper.mediasize < ((Maxmem * (off_t)PAGE_SIZE) + > > (sizeof kdh * 2) + (16*1024)) { > > /* 16K is an arbitrary buffer > > * in case the swap part is > > * the first part > > */ > > printf("\nDump failed. Partition too small.\n"); > > return; > > } 233 dumpsys(&dumper); 234 } but I guess that assumes that each architecture doesn't have sparse dumps or sparse address spaces.. > > > Cheers, > -Peter > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com > "All of this is for nothing if we don't go to the stars" - JMS/B5 > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message