On Thu, 17 Feb 2005 10:38:36 -0500 (EST), Alan Stern <[EMAIL PROTECTED]> wrote: > On Thu, 17 Feb 2005, Sara Fonseca wrote: > > > I simulated a block error doing this: when the host tries to read one > > specific logical block, I change some bytes. The I try two things: > > 1) Just returns the number of bytes the host expects and finish with > > no erros. The host just reports I/O error and doesnt take any other > > action. > > Do you know why the host reports an I/O error if you finish with no > errors? How does the host realize that something went wrong? Actually just the SCSI system detects the error(the data doesn't make sense). Here is the error that it reports:
usb-storage: *** thread sleeping. SCSI error : <159 0 0 0> return code = 0x10070000 end_request: I/O error, dev sda, sector 8 Buffer I/O error on device sda, logical block 1 > > > 2) Detect the error, stall bulk-in and report a command failed. As > > sense data i return > > usb-storage: -- code: 0xf0, key: 0x3, ASC: 0x11, ASCQ: 0x0 > > usb-storage: Medium Error: Unrecovered read error > > > > It seems like the host should ignore the damaged logical block, but > > that isnt done. > > Why should the host ignore the damaged block? I would expect the host to > retry the read several times, eventually give up, and put an error message > in the system log. That's very different from ignoring it. I performed this test by creating a fyle system in the device. When I sad that It should ignore it, I meant that it shouldn't use it. The host repeats the read several times indeed and then reports the following: SCSI error : <158 0 0 0> return code = 0x8000002 Info fld=0x1, Current sda: sense key Medium Error Additional sense: Unrecovered read error end_request: I/O error, dev sda, sector 8 Buffer I/O error on device sda, logical block 1 So it knows the logical block is damaged. And it even finishes creating the file system. But then doesn't recognize any file system when I try to mount it. > > Of course, what actually happens depends very much on what host you are > using. > > Alan Stern > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel