Share

openMosix

Tracker: Bugs

5 MFS handles st_dev differently for stat and fstat - ID: 744889
Last Update: Comment added ( mosheb )

Here is an example program:

#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <stddef.h>
#include <fcntl.h>

main(int argc,char **argv) {
struct stat s1;
struct stat s2;
int fd;

fd=open(argv[1],O_RDONLY);
fstat(fd,&s2);
stat(argv[1],&s1);
printf("%08x", s1.st_dev >> 32);
printf("%08x\n", s1.st_dev);
printf("%08x", s2.st_dev >> 32);
printf("%08x\n", s2.st_dev);

}


If you run that against a file inside mfs, e.g.

copcsl01:/tmp# ./test /mfs/here/tmp/test.c
08020000000000ff
0802c09a000000ff
copcsl01:/tmp#

Then as you see, you get different results for stat()
and fstat() in the st_dev. (top number is stat() bottom
is fstat())

This shouldn't be too much of an issue since the
difference is not in the major nor minor numbers,
however it does make cp fail, e.g.

copcsl01:/tmp# cp /mfs/here/tmp/test.c test2.c
cp: skipping file `/mfs/here/tmp/test.c', as it was
replaced while being copied
copcsl01:/tmp#

This messes up an awful lot of stuff.


Daniel Silverstone ( kinnison ) - 2003-05-28 13:23

5

Closed

Accepted

Moshe Bar

MFS

v.2.4.20(openMosix 1.8.0)

Public


Comment ( 1 )




Date: 2003-05-31 06:35
Sender: moshebProject AdminAccepting Donations

Logged In: YES
user_id=6632

Any patch for that???


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2003-05-31 06:35 mosheb
resolution_id None 2003-05-31 06:35 mosheb
assigned_to nobody 2003-05-31 06:35 mosheb
close_date - 2003-05-31 06:35 mosheb