From owner-freebsd-current@FreeBSD.ORG Sat Nov 24 07:07:01 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CE0F16A418 for ; Sat, 24 Nov 2007 07:07:01 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 463D313C45B for ; Sat, 24 Nov 2007 07:07:00 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.1/8.14.1) id lAO6lC6u029440; Sat, 24 Nov 2007 00:47:12 -0600 (CST) (envelope-from dan) Date: Sat, 24 Nov 2007 00:47:11 -0600 From: Dan Nelson To: Julian Elischer Message-ID: <20071124064711.GB4226@dan.emsphone.com> References: <4747A9B8.9080403@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4747A9B8.9080403@elischer.org> X-OS: FreeBSD 7.0-BETA3 User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Alan Cox , FreeBSD Current Subject: Re: suggested ways of faking EIO? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2007 07:07:01 -0000 In the last episode (Nov 23), Julian Elischer said: > I need to make physio make a request from disk, and have the request > come back asynchronously with an EIO. > > I have tried just reading some distance past the end of a partition, > but I'm not totally convinced that it acts exactly like as if I'd > tried to read a bad sector. Since geom has been added, the legality > of a read needs to be tested in the geometry layer, so I suppose it > must come back asynchronously, as that is no longer directly executed > through function calls but is it really the same as a disk failure? > > Anyone done this? or does anyone have a disk with a known bad sector > I can try my test case on? :-) The geom NOP module can fail a given percentage of I/O with whatever error number you choose. You could hack g_nop.c to make it fail on a given sector instead. -- Dan Nelson dnelson@allantgroup.com