From owner-freebsd-hackers@freebsd.org Thu Jul 30 15:22:32 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 776D19AFE89 for ; Thu, 30 Jul 2015 15:22:32 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0100.outbound.protection.outlook.com [207.46.100.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (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 3D540780 for ; Thu, 30 Jul 2015 15:22:31 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from CY1PR08MB1803.namprd08.prod.outlook.com (10.162.218.25) by CY1PR08MB1803.namprd08.prod.outlook.com (10.162.218.25) with Microsoft SMTP Server (TLS) id 15.1.225.19; Thu, 30 Jul 2015 15:22:23 +0000 Received: from CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) by CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) with mapi id 15.01.0225.018; Thu, 30 Jul 2015 15:22:23 +0000 From: "Pokala, Ravi" To: "freebsd-hackers@freebsd.org" Subject: Re: getting a disk structure given a device name Thread-Topic: getting a disk structure given a device name Thread-Index: AQHQytuHO8XJBMwAhUqHp7B79j2JNQ== Date: Thu, 30 Jul 2015 15:22:22 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.3.150624 authentication-results: freebsd.org; dkim=none (message not signed) header.d=none; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [24.6.178.251] x-microsoft-exchange-diagnostics: 1; CY1PR08MB1803; 5:iL6dLK/im0IOgn5pWKixA7TYHbSNycbQQzPhkXD0EmgNjlR52QXEn10TePrveSxoDWq+ys+oUzFbYIEKr6LFt5xKtA839Z0pvIou71UNoOpMwndv5iGXF82K+2GQ43gFv4iz4LZJbdk9j9l//HHa3A==; 24:dhOU1oADMbFPd7CGCapE60CrLburu4XKN1KFQl3mhF6X9Sef+SHid2Brqq85NkirnexbFR923mbAk+dOvKL0qae2e1dzMBzmywqnNRfgbX0=; 20:MtC+OtkD2tGkqHCT/US0RlCBjeABEBlg/DH9TM0Nprg0URo2VZKqBUM0ON1P6rWHzF7SoilXOP78qnkfal1W4A== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR08MB1803; cy1pr08mb1803: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CY1PR08MB1803; BCL:0; PCL:0; RULEID:; SRVR:CY1PR08MB1803; x-forefront-prvs: 06530126A4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(53754006)(86362001)(106116001)(110136002)(102836002)(50986999)(107886002)(77156002)(2656002)(62966003)(5001960100002)(83506001)(40100003)(450100001)(512954002)(87936001)(122556002)(92566002)(2501003)(66066001)(19580395003)(4001350100001)(19580405001)(46102003)(2351001)(99286002)(5002640100001)(189998001)(77096005)(2900100001)(54356999)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR08MB1803; H:CY1PR08MB1803.namprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: panasas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2015 15:22:22.7900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: acf01c9d-c699-42af-bdbb-44bf582e60b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR08MB1803 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2015 15:22:32 -0000 >Date: Wed, 29 Jul 2015 23:31:03 +0000 >From: Raviprakash Darbha >To: "freebsd-hackers@freebsd.org" >Cc: Steve Kiernan , Simon Gerraty > >Subject: getting a disk structure given a device name >Message-ID: >Content-Type: text/plain; charset=3D"us-ascii" > >Hello All=20 > >I am trying to write a filter driver for the ata block on freebsd 6.2 to >simulate failed reads and writes. We originally did something like that at Panasas, but by hacking ata(4) and ad(4) directly. :-P Later on, we created a GEOM class to do error injection. Currently, I prefer using the WRITE_UNCORRECTABLE48 command, to tell the drive to actually return errors on subsequent reads. That has the benefit of being indistinguishable from an actual read failure - the drive spends the time to do error recovery, and sends the actual error code back. -Ravi