From: Paul <krushka@iprimus.com.au>
To: linux-kernel@vger.kernel.org
Cc: Rogier Wolff <R.E.Wolff@BitWizard.nl>
Subject: Re: Fwd: File system corruption
Date: Wed, 8 Jan 2003 23:38:22 +1000 [thread overview]
Message-ID: <03010823382201.01198@paul.home.com.au> (raw)
In-Reply-To: <20030107130832.A4953@bitwizard.nl>
I have put the gzipped image here if anyone wants to take a peek :)
size==348k, unzips to ~64Mb
http://home.iprimus.com.au/krushka/img.gz
On Tue, 7 Jan 2003 10:08 pm, you wrote:
> 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 <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <string.h>
>
> 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<argc;i++) {
> if (strcmp (argv[i], "-a") == 0) {
> ascii = 1;
> }
> if (strcmp (argv[i], "-b") == 0) {
> ascii = 0;
> }
>
> if (strncmp (argv[i], "-s", 2) == 0) {
> if (strlen (argv[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<size;i+=s)
> sprintf (buf+i, "%lld\n", secno);
> } else {
> for (i=0;i<size;i+=sizeof (long long))
> *(long long *)(buf+i) = secno;
> }
> if (write (1, buf, size) < 0)
> break;
> secno++;
> }
> exit (0);
> }
prev parent reply other threads:[~2003-01-08 13:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-06 11:38 Paul
2003-01-06 15:06 ` Alan Cox
2003-01-06 14:31 ` Arjan van de Ven
2003-01-07 12:08 ` Rogier Wolff
2003-01-08 11:35 ` Paul
2003-01-08 14:15 ` Alan Cox
2003-01-08 13:55 ` Rogier Wolff
2003-01-31 12:12 ` Paul
2003-01-08 13:38 ` Paul [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03010823382201.01198@paul.home.com.au \
--to=krushka@iprimus.com.au \
--cc=R.E.Wolff@BitWizard.nl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®