Hi Steve,
I executed Shell-scrippt, as I changed lseek second argument value
to 4096*12, 4096*14, 4096*15, 4096*17, 4096*18, 4096*20 from 4096*16.
Shell-script was normal end. Only 4096*16(10000H) is a problem.
Physical address 10000H-13fffH is inode chunk area on dev/hda7.
I think
Inode chunk area is in page buffers. Read function access to page
buffers.
If read function access to device, page buffers are broken.
My Shell-scrippt (org-g.sh) is :
umount /dev/hda7
/usr/src/cmd/xfsprogs/mkfs/mkfs.xfs -f -l agnum=1,size=2000b /dev/hda7
mount /dev/hda7 /mnt/xfs
cd /mnt/xfs
tar zxvf /test/xfs-cmd.tar.gz
/test/test_dev_read
cd /test
rm -rf /mnt/xfs/cmd
and my program (test_dev_read.c) is :
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
int main( argc, argv )
int argc;
const char *argv[];
{
int fd,ret,i,error;
char bufl[4096];
if( ( fd = open( "/dev/hda7" , O_RDONLY , S_IRWXU ) ) < 0 ){
printf( "error= %s\n" , strerror(errno) );
return;
}
for( i=0; i<1; i++ ){
ret = 40;
error = read( fd , bufl , ret );
printf( "test read1 finish = %x \n",(char)bufl[0] );
}
if ( lseek( fd, 4096*16, SEEK_CUR ) == -1 ){
printf( "error2= %s\n" , strerror(errno) );
}
for( i=0; i<1; i++ ){
ret = 40;
error = read( fd , bufl , ret );
printf( "test read2 finish = %x \n",(char)bufl[0] );
}
printf( "test program finish \n" );
close( fd );
}
Thanks.
-nak
>
> At the moment I cannot - it may possibly be very specific to which
> blocks in the filesystem you read - which in turn would be related
> to exactly how large the filesystem is. Does varying where you read
> from the block device make any difference here?
>
> Steve
>
|