This message got blocked by a spam filter - probably the binary data
in the middle of it.
On Fri, 2002-06-14 at 13:26, you wrote:
>
> Hi,
>
> We have problem with mmaping files from XFS partition on
> our 2.4.18 kernels (xfs 03062002, previously 20020517), x86.
>
> Testcase - mmapcat.c :
> #include<fcntl.h>
> #include <unistd.h>
> #include <sys/mman.h>
> #include <sys/stat.h>
> #include <stdio.h>
>
> int main(int argc, char **argv)
> {
> int fd,n;
> char *ptr;
> struct stat st;
> fd=open(argv[1],O_RDONLY);
> if(fd<0){perror(argv[1]);exit(1);}
> fstat(fd,&st);
> if(st.st_size%4096==0){fprintf(stderr,"bad file size!\n");exit(1);}
> ptr = mmap(NULL,st.st_size,PROT_READ,MAP_PRIVATE,fd,0);
> while (*ptr!=0)
> write(1,ptr++,1);
> exit(0);
> }
>
> # mmapcat /usr/include/stdio.h gives at the end
>
> #endif /* <stdio.h> included. */
>
> #endif /* !_STDIO_H */
Binary data removed.
> (some junk at the end). Sometimes mmapcat even crashes. There is no
> problem on ext2 for example.
>
> Please try to run this simple script on your xfs partitions:
> for a in `find /usr/include -type f -print`; do
> if [ "$(cat $a 2>&1)" != "$(./mmapcat $a 2>&1)" ]; then
> echo "DIFFER: $a"
> fi
> done
>
> For me:
> [misiek@arm misiek]$ ./xfs-test.sh | grep DIFFER | wc -l
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> Memory fault (core dumped)
> 277
This test program works here on the current xfs code base. Which
suggests this is either something we have fixed, or a problem
with something else in your tree.
Steve
--
Steve Lord voice: +1-651-683-3511
Principal Engineer, Filesystem Software email: lord@xxxxxxx
|