Re: data corruption: revalidating a (removable) hdd/flash onre-insert

From: Pavel Machek
Date: Tue Nov 04 2008 - 16:26:40 EST


On Wed 2008-11-05 00:22:51, Michael Tokarev wrote:
> Pavel Machek wrote:
>>>>> Every access to removable media is guarded by this revalidation check.
>>>>> If you don't see these events, you should not trust this reader, and
>>>>> at least never change the media while it is connected.
>>>> This is rather nasty data-corrupter.
>>> Sure, it is.
>>>
>>>> Could we at least blacklist
>>>> broken device, and force revalidation on each close or something like
>>>> that?
>>> What's your idea of revalidation if the hardware does not tell you?
>>> Get an md5 of the disk content? :)
>>
>> Well... you should not eject media while fs is mounted or blockdev is
>> open, correct?
>>
>> So can we simply claim 'media changed' on last close/unmount? Sure,
>> sometimes media was not changed, but that only hurts performance, not
>> correctness... ?
>
> Well, that's what my tiny proggy, which I used here to work around the
> problem, does. It constantly opens/closes the /dev/sdFOO, every 0.5s
> currently (I don't think I will be able to replace a media faster than
> half a second :), in order to catch REMOVALs of media -- because when
> the drive does not see the media anymore, it correctly reports that
> the media has changed...

Ok, so we you need to do is to put it into kernel and activate it
via blacklist...?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/