| Summary: | NFS client appears to lose data | ||
|---|---|---|---|
| Product: | Base System | Reporter: | amobbs <amobbs> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: freebsd-bugs->dillon Over to Mr NFS. :-) Responsible Changed From-To: dillon->freebsd-bugs Back to the free pool. State Changed From-To: open->closed I am unable to reproduce this. Your code does not compile as it stands because of "init_mutex(&mutex);", which suggests it was originally written as a multi-threaded program. Removing this call, I do not experience any unexpected results on a 4.x NFS server. Either the bug has been fixed, or your problem was actually a threading bug in your test code. |
As far as I can tell, the following program will lose data on a FreeBSD->FreeBSD NFS mount, but not on a FreeBSD->{Solaris,Linux,AIX} or a {Solaris,Linux}->FreeBSD mount (Notation is server->client) All mounts are hard. NFS options are whatever the default on a given platform is. Network is 100MBps switched ethernet. The output file "testfile" loses occasional characters OS versions: Solaris 2.5.1 (sparc) Linux 2.2.10 (i386) FreeBSD 3.3-RC (client) (i386) FreeBSD 3.2-R (server) (i386) AIX 4.2 (rs6000) How-To-Repeat: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <time.h> #include <errno.h> #include <sys/types.h> main(void){ int error=0,len,i; FILE *fp; pid_t mypid; char str[80]; init_mutex(&mutex); srandom(time(NULL)); mypid=getpid(); sprintf(str,"Hello, I'm process %d.\n",mypid); len=strlen(str); if((fp=fopen("testfile","a+"))==NULL){ fprintf(stderr,"Cannot open testfile failed %d\n",errno); exit(1); } for(;;){ for(i=0;i<len;i++){ fputc(str[i],fp); usleep((random()%1000)*100); fflush(fp); } } }