Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756400AbYKDUUd (ORCPT ); Tue, 4 Nov 2008 15:20:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753998AbYKDUUZ (ORCPT ); Tue, 4 Nov 2008 15:20:25 -0500 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:58807 "EHLO UNKNOWN" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753981AbYKDUUY (ORCPT ); Tue, 4 Nov 2008 15:20:24 -0500 Date: Tue, 4 Nov 2008 21:20:11 +0100 From: Pavel Machek To: Kay Sievers Cc: Michael Tokarev , Kernel Mailing List Subject: Re: data corruption: revalidating a (removable) hdd/flash on re-insert Message-ID: <20081104202011.GA7135@ucw.cz> References: <490B2659.9010304@msgid.tls.msk.ru> <20081104195728.GC5862@ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 31 > >> 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... ? 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/