Linux-kernel mailing list archive 1999-23,: (sorry) Re: files >4gig -- 2.2.9 is corrupting disk!

# (sorry) Re: files >4gig -- 2.2.9 is corrupting disk!

Pavel Machek (pavel@bug.ucw.cz)
Sun, 6 Jun 1999 12:29:19 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Rogerio Brito: "Re: Linux 2.2.* remote exploit fix"
- Previous message: Pavel Machek: "Re: 2.3 wish: integrate pcmcia into mainstream kernel"

Hi!

> > So I created a 17 gig file using Linux 2.2.9 & a file in /tmp. Interestingly
> > enough at 17 gig I get an error 22 ( still have space & inodes
> > available ) .
>
> Reproduced on my 2.2.9/i386. Program does something different than it
> claims to (due to limited ranges of ints etc), but causes
> corruption. When I did ls -l c after run I saw rwx-----T or something
> this crazy. I tried it twice, worked both times.

Sorry, my fault. I did not notice how wrong the code is. It creates
file but passes uninitialized variable as intial permissions. That's
what led me to thinking that my disk got trashed.

> If you don't want to trash your harddisk, be sure to sync; killall
> bdflush; sync; run test; look what it caused and then _POWER OFF
> WITHOUT SYNCING_.
>
> > #include <stdio.h>
> > #include <errno.h>
> > #include <fcntl.h>
> > #include <unistd.h>
> > /******************** BE CAREFULL ******************************/
> > /* This can kill the superblock on the partition the file is written on */
> > /* Which may not be recoverable gat 6/5/99 */
> > /******************** BE CAREFULL *******************************/
> >
> > main()
> > {
> > long l,r;
> > int e, w;
> > int fd;
> > fd = open("c",O_RDWR|O_CREAT|O_TRUNC);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~, 0777 is missing
here.

> >
> > for ( l=0; l < 64000000000L; l+=1000000) {
> > r = lseek(fd, l, 0);
> > w = write(fd,"a",1);
> > fprintf(stderr,"r=%lx, w=%d, l=%ld\n", r,w,l);
> > }
> > }
>

    --
    I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.  Pavel
    Hi! I'm a .signature virus! Copy me into your ~/.signature, please!

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Rogerio Brito: "Re: Linux 2.2.* remote exploit fix"
- Previous message: Pavel Machek: "Re: 2.3 wish: integrate pcmcia into mainstream kernel"