Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Jim Nance <jlnance@avanticorp.com>
Subject: 64 Bits from Larry McVoy
Date: Mon, 4 Nov 1996 08:02:36 -0500 (EST)	[thread overview]
Message-ID: <17a3d1529f134ae20d52a1f0c4dd2252.axp-list@archive.invalid> (raw)

Forwarded message:

> Linux is 64 bit in that the types are right.  Linux is not 64 bit in that 
> the file systems don't support >32 bit offsets (something that wouldn't
> be hard to fix, sounds like a version number on ext2fs).

Well Larry,
    I was almost sure you were wrong, so I wrote the following test program.
Unfortunatly, I did manage to tickle enough linux bugs so that you can
claim you are right :-)  So instead of claiming victory, I will submit
a bug report :-(  For those intrested in reproducing this, I am running
Redhat 4.0 with redhats kernel, and the partition I am working contains an
800MB ext2 file system.  Here is the program.  It tries to make a large
sparse file:

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define GB ((long)(1024*1024*1024)/2)
#define NG (20L)

int main()
{
    off_t offset;
    int fd = open("bigfile", O_CREAT|O_TRUNC|O_WRONLY);

    if(fd<0) {perror("open:"); exit(1);}

    for(offset=0; offset<NG*GB; offset += GB) {
	int   num;
        off_t pos = lseek(fd, offset, SEEK_SET);
	if(pos!=offset) {perror("lseek:"); exit(1);}
	num=write(fd,"x",1);
	if(num!=1) {perror("write:"); exit(1);}
    }

printf("Done!");
return 0;
}

The first thing to notice is that I have divided GB by 2.  If I don't do
this the program fails after making a 1G file, and I get a nice printk()
from the ext2fs.  So I divided by two and reran.  Now I can make a very
large file, but something is still wrong:

total 76
-rwxrwxrwx   1 jlnance  users       14378 Nov  4 07:39 a.out*
-rw-rw-rw-   1 jlnance  users         544 Nov  4 07:38 big.c
-r-xrwS--T   1 jlnance  users    10200547329 Nov  4 07:43 bigfile*

I don't know how the S--T bits got set on bigfile, but I certainly did
not mean to do it.  I have also found that if I do much in the directory
containing bigfile, its size will eventually shrink down to 1.6G.

Anyone have any ideas?

Jim

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1996-11-04 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-04 13:02 Jim Nance [this message]
     [not found] <9611041302.AA00548@scooter>
1996-11-04 23:10 ` 64 Bits from Larry McVoy Marc Singer
1996-11-05  0:23 ` Richard Henderson
     [not found] <Pine.LNX.3.93.961105175237.464A-100000@darkstar.chrigi.net>
1996-11-06 12:20 ` Jim Nance
1996-11-06 12:34   ` Philip Blundell
1996-11-07 18:58   ` Christian Hardmeier
     [not found] <Pine.SOL.3.95.961106122811.7441C-100000@hammer.thor.cam.ac.uk>
1996-11-06 12:57 ` Jim Nance
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox