On 09/11/2022 23:31, Grant Edwards wrote:
If I recall correctly, it will add any unreadable blocks to its
internal list of bad sectors, which it will then refuse to allocate
in the future.
I doubt you recall correctly. You should ONLY EVER conclude a block is
bad if you can't write to it. Remember what I said - if I read my 8TB
drive from end-to-end twice, then I should *expect* a read error ...
I'm asking what happens to the file containing the bad block. Perphaps
nothing. The man page says the block is added to the "bad block
inode". If that block was already allocated, is the bad block is now
allocated to two different inodes?
If a read fails, you SHOULD NOT do anything. If a write fails, you move
the block and mark the failed block as bad. But seeing as you've moved
the block, the bad block is no longer allocated to any file ...
Cheers,
Wol