2007-10-26 15:50:41

by Frank van Maarseveen

[permalink] [raw]
Subject: 2.6.23.1 regression: write() data lost after lseek()

2.6.23.1 client (using 2.6.22.10 and 2.6.21.7 as server), mount options
according to /proc/mounts:

rw,nodev,vers=3,rsize=32768,wsize=32768,hard,intr,proto=udp,timeo=11,retrans=2,sec=sys


The data of the last write in this program gets lost when run on 2.6.23.1 client:

--------
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>

int main(int argc, char **argv)
{
int d;

errno = 0;
d = open(argv[1], O_CREAT|O_WRONLY|O_TRUNC, 0666);
write(d, "a", 1);
lseek(d, 2, SEEK_SET);
write(d, "data lost\n", 10);
close(d);
perror("");
return errno ? 1 : 0;
}
--------

$ ./prog out
Success
$ od -c out
0000000 a \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000014


--
Frank

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs