Replying first to Hans Reiser; below to Russell King and Pavel Machek.perform the write after the failed read, that way the drive knows it is a bad block at the time you write.
Instead of recording the bad blocks, just write to them.
If writes are guaranteed to force reallocations then this is potentially
part of a solution.
I still remain suspicious because the first failed read was milliseconds or
minutes after the preceding write. I think the odds are very high that the
sector was already bad at the time of the write but reallocation did not
occur. It is possible but I think very unlikely that the sector was
reallocated to a different physical sector which went bad milliseconds after
being written after reallocation, and equally unlikely that the sector
wasn't reallocated because it really hadn't been bad but went bad
milliseconds later. In other words, I think it is overwhelmingly likely
that the write failed but was not detected as such and did not result in
reallocation.
Now, maybe there is a technique to force it anyway. When a partition isI think I discussed with Vitaly offering users the option of writing, reading, and then writing again, every block before mkreiserfs. I forget what happened to that idea, Vitaly?
newly created and is being formatted with the intention of writing data a
few minutes later, do writes that "should" have a better chance of being
detected. The way to start this is to simply write every block, but this is
obviously insufficient because my block did get written shortly after the
partition was formatted and that write didn't cause the block to be
reallocated. So in addition to simply writing every block, also read every
block. For each read that fails, proceed to do another write which "should"
force reallocation.
Mr. Reiser, when I created a partition of your design, that technique was
not offered. Why? And will it soon start being offered?
Also, I remain highly suspicious that for each read that fails, when theI am not going to worry about such suspicions without evidence or drive manufacturer comment, as it has not been our experience so far.
formatting program proceeds to do another write which "should" force
reallocation, the drive might not do it.
There is a general problem with reporting urgent kernel messages to users thanks to GUIs covering over the console.
Why does it matter? The drive already reported a read failure. Maybe Linux
programs aren't all smart enough to inform the user when a read operation
results in an I/O error, but drivers could be smarter.