From owner-freebsd-current@FreeBSD.ORG Sat Nov 24 04:34:04 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 2EAF716A41B for ; Sat, 24 Nov 2007 04:34:04 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outZ.internet-mail-service.net (outZ.internet-mail-service.net [216.240.47.249]) by mx1.freebsd.org (Postfix) with ESMTP id 3960813C47E for ; Sat, 24 Nov 2007 04:34:04 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Fri, 23 Nov 2007 20:34:03 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id D6406126AAC; Fri, 23 Nov 2007 20:34:01 -0800 (PST) Message-ID: <4747A9B8.9080403@elischer.org> Date: Fri, 23 Nov 2007 20:34:00 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: FreeBSD Current , Alan Cox Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: 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 04:34:04 -0000 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 actual case in quesiton is an AIO operation that gets an error, reported back via Kqueue. The bug is to find out whether the correct info is fed back by both kqueue and aio. BTW my little test program is at: http://people.freebsd.org/~julian/aiu-kqueue-error.c BTW2 it took me a little time to write it but I think it could be cleaned up a but and put in the documentation as sample code as to how to use kqueue together with AIO as I didn't find any examples of how to do this. I'm looking at this because I received a report that kqueue wasn't reporting the error correctly, but this program shows to to be doing so. For this reason I'm trying to see if I'm testing the wrong thing.