Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2007 20:34:00 -0800
From:      Julian Elischer <julian@elischer.org>
To:        FreeBSD Current <current@freebsd.org>, Alan Cox <alc@cs.rice.edu>
Subject:   suggested ways of faking EIO?
Message-ID:  <4747A9B8.9080403@elischer.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4747A9B8.9080403>