From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 1 17:27:55 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C88DBF10 for ; Wed, 1 Oct 2014 17:27:55 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0083.outbound.protection.outlook.com [157.56.110.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 723E898E for ; Wed, 1 Oct 2014 17:27:54 +0000 (UTC) Received: from DM2PR0801MB0944.namprd08.prod.outlook.com (25.160.131.27) by DM2PR0801MB0944.namprd08.prod.outlook.com (25.160.131.27) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Wed, 1 Oct 2014 17:12:19 +0000 Received: from DM2PR0801MB0944.namprd08.prod.outlook.com ([25.160.131.27]) by DM2PR0801MB0944.namprd08.prod.outlook.com ([25.160.131.27]) with mapi id 15.00.1039.011; Wed, 1 Oct 2014 17:12:19 +0000 From: "Pokala, Ravi" To: "freebsd-hackers@freebsd.org" Subject: Re: dumpsys/savecore on AF-4Kn drives? Thread-Topic: dumpsys/savecore on AF-4Kn drives? Thread-Index: AQHP3QFgvwLpNOmcHUaIK0Ete9ljB5wbBlIA Date: Wed, 1 Oct 2014 17:12:19 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.4.140807 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [24.6.178.251] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0801MB0944; x-forefront-prvs: 0351D213B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(189002)(164054003)(377454003)(51704005)(199003)(20776003)(83506001)(101416001)(2351001)(107886001)(99396003)(80022003)(46102003)(85852003)(54356999)(76176999)(21056001)(50986999)(86362001)(64706001)(2656002)(19580395003)(92566001)(92726001)(19580405001)(66066001)(31966008)(85306004)(87936001)(105586002)(120916001)(95666004)(4396001)(10300001)(76482002)(107046002)(77096002)(110136001)(36756003)(99286002)(97736003)(106356001)(106116001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0801MB0944; H:DM2PR0801MB0944.namprd08.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Content-Type: text/plain; charset="us-ascii" Content-ID: <056BA62C25CA864480C517738B4FCDB0@namprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: panasas.com X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 17:27:55 -0000 Re-posting something that was sent to me off-list, so the thread stays up-to-date: From: , Conrad Date: Wednesday, October 1, 2014 at 6:05 AM To: Ravi Pokala Subject: RE: dumpsys/savecore on AF-4Kn drives? Ravi, Skipping freebsd-hackers@ as I can't get Outlook to reply in the right way. savecore(1) uses raw read(2) calls to the passed device. FreeBSD DevFS doesn't support non-native block sizes, so that's probably where EINVAL is coming from. To support 4Kn from that end you could probably convert savecore(1) from read(2) and friends to fread(3) (assuming libc does the right thing re: native sector size). The kernel dump code is all DEV_BSIZE (512), but the backing dump device is free to do Read-Modify-Write to satisfy those 512 byte writes during dump. I don't know if gmirror does this, but if you were able to create a dump without error/panic, it probably does. Most of this code hasn't been touched since 2002 or so, 4Kn is a project :). Good luck! Hope that helps, Conrad -----Original Message----- From: , Ravi Pokala Date: Tuesday, September 30, 2014 at 3:53 PM To: "freebsd-hackers@freebsd.org" Subject: dumpsys/savecore on AF-4Kn drives? >Hi folks, > >Does anyone out there have AF-4Kn drives (both logical and physical sector >size is 4KB)? Have you been able to drop a core to one, and successfully >save the core on the way back up? > >I'm working on adding AF-4Kn support to an older version of FreeBSD (based >on 7 - yeah, I know... :-P), using -CURRENT as a reference. Things look >good at the GEOM level and higher; the GEOM utils report correct sizes, >UFS runs fine, etc. If I manually break into the debugger and 'call >doadump', it appears to work; at least, it does not report any errors. But >when I reboot, `savecore' complains: > > error reading dump header at offset 0 in /dev/mirror/gm1: Invalid >argument > >(Yes, it's dumping to a mirror; no, that's not the problem: the mirror is >configured using the 'prefer' balancing algorithm, as described in >gmirror(8), and we've been doing this without issue for years.) > >I'm trying to figure out if the problem is on the dumpsys side, the >savecore side, or if they're both broken for AF-4Kn. In particular, >'struct kerneldumpheader' is 512 bytes, and it looks like most calls to >dump_write() in the full-dump context (not minidumps) pass either the size >of the structure, or an explicit 512, for the 'length' argument. That's >the case in both the 7-ish version I'm porting to, and in -CURRENT. > >There's no AF-4Kn-aware bootstrap in the version we're using (emaste@ - >does the new UEFI bootstrap in 10-STABLE work w/ AF-4Kn drives?), so one >of the drives is 512n, and I could probably find some space on there to >save the core to. But that device is small, and we have other uses for it, >so I'd like to avoid reserving a large chunk of it. > >Any thoughts? > >Thanks, > >Ravi >