kernel BUG [Was: Re: rm and ls don't work for large files]

From: Goswin Brederlow (goswin.brederlow@student.uni-tuebingen.de)
Date: Fri Aug 25 2000 - 10:07:31 EST


ls does not show the correct size for files greater than 4G:

% ls -ls file_greater_than_4G

8422534 -rw-rw-r-- 1 mrvn mrvn 1048576 Aug 25 23:14 file_greater_than_4G

The wrong size seems to be a kernel problem:

from /usr/src/linux/include/asm-i386/posix_types.h:
typedef long __kernel_off_t;

from /usr/src/linux/include/types.h:
typedef __kernel_off_t off_t;

from /usr/src/linux/include/linux/fs.h: struct inode {
        loff_t i_size;

from /usr/src/linux/fs/stat.c: static long cp_new_stat64(struct inode * inode, struct stat64 * statbuf)
        tmp.st_size = inode->i_size;

So lstat64 get the size from the internl inode structure and that uses
a 32 Bit value for the size on 32 Bit systems. There is no way to get
the correct size for big files.

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



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:16 EST