Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 7 Jan 2003 07:00:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 7 Jan 2003 07:00:22 -0500 Received: from users.linvision.com ([62.58.92.114]:18919 "EHLO abraracourcix.bitwizard.nl") by vger.kernel.org with ESMTP id ; Tue, 7 Jan 2003 07:00:21 -0500 Date: Tue, 7 Jan 2003 13:08:33 +0100 From: Rogier Wolff To: Alan Cox Cc: krushka@iprimus.com.au, Linux Kernel Mailing List Subject: Re: Fwd: File system corruption Message-ID: <20030107130832.A4953@bitwizard.nl> References: <0301062138130A.01466@paul.home.com.au> <1041865580.17472.17.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1041865580.17472.17.camel@irongate.swansea.linux.org.uk> User-Agent: Mutt/1.3.22.1i Organization: BitWizard.nl Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2071 Lines: 82 On Mon, Jan 06, 2003 at 03:06:20PM +0000, Alan Cox wrote: > Might be interesting to see what it does given a totally not FAT > environment (eg fill the disk start to end with each sector filled > with its sector number repeatedly) and see what comes out the other > end. How about the following program to do this. Roger. /* Written By R.E.Wolff@BitWizard.nl * * This program is distributed under GPL. */ #include #include #include #include int main (int argc, char **argv) { int i; int ascii = 0; int size = 512; long long secno; char *buf; int s; for (i=1;i 2) size = atoi (argv[i]+2); else /* Sorry. Will crash if you specify -s as the last argument */ size = atoi (argv[++i]); } } buf = malloc (size + 16); if (!buf) { fprintf (stderr, "Can't allocate buffer.\n"); exit (1); } secno = 0; while (1) { if (ascii) { sprintf (buf, "%lld\n", secno); s = strlen (buf); for (i=s;i