Re: Problem: Bad blocks on IDE disk

Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Mon, 14 Dec 1998 17:38:06 +0100 (CET)


On Mon, 14 Dec 1998, Mark Lord wrote:

> Andrzej Krzysztofowicz wrote:
> >
> > Hi,
> > Recently a few bad sectors appeared on my IDE disk. And I observed
> > wrong (in my opinion) behaviour of IDE driver while handling the bad
> > sectors:
> >
> > 1. PIO mode
> > when multicount is set to non zero value the IDE driver generates
> > an error even if reading of a bad sector is not directly requested,
> > but the it is located in the
> > <block_requested+1>..<block_requested+multicount_value-1>
> > area.
>
> This is not a driver issue, but rather, a filesystem one.

I'm rather sure that this is a driver problem. I tested it doing
dd /dev/hd?? or mke2fs /dev/hd?? as first access to the disk
after re-reading partition-table (cache is invalidated then).

> If you don't want the filesystem code to perform
> block-device read-ahead, then TURN IT OFF!!

Yes, hdparm -m0 -a0 is a solution.

But I don't think it is the right solution.
Notice that I can't turn off the read-ahead for a single filesystem or
even single disk. It is per-major-number feature, so it is set for both
disks on the channel :(

> ...
> > I think the IDE driver *should not* generate an error (eventually a warning)
> > when reading of real bad block is *not* directly requested. I hope that
> > ide disk reports the number of sectors (on an I/O port) that have been read
> > during an IDE command (even if it sets simultaneously one or more error
> > flags).
>
> In DMA mode, there is no way to know where a transfer was aborted.

Maybe it should retry without read-ahead and generate an error when it
fails again ?

> In PIO mode, *maybe* we can tell, but it is very difficult to handle
> in the way suggested.

*Why* is it difficult ?
I think it would be nice to have it in 2.3/2.4 ...

Regards
Andrzej

--
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/