Messages in this thread | | | Date | Wed, 9 Jun 2004 21:17:58 +0200 | Subject | 2.6.X File locking on NFS stil broken | From | Ruben Puettmann <> |
| |
hello,
I have a big iproblem with the nfs file locking on some 2.6 er kernel
Kernel Server: 2.4.9 Kernel Client: 2.6.7-rc3-bk2 2.6.6-rc3-mm2 2.6.5
mount options :
10.0.0.149:/export /mnt/server nfs rw,auto,soft,bg,timeo=12,retrans=3,in tr,rsize=8192,wsize=8192,mountvers=3,nfsvers=3,udp 0 0
nfs-utils : 1.0.6
Both Server an Client Debian Sarge. Wiht kernel 2.4.21-pre5 the locking runs very fine against the server.
This little testscript I used ( got it from a friend):
#define _GNU_SOURCE #include <unistd.h> #include <stdio.h> #include <fcntl.h> #include <string.h> #include <errno.h>
int main(int c, char **v) { for (++v, --c; c--; ++v) { struct flock lck = {F_RDLCK, SEEK_SET, 0, 0}; /* whole file */ int fd = open(*v, O_RDONLY); if ( fd < 0 ) fprintf(stderr, "%s: %s\n", *v, strerror(errno)); else { if ( fcntl(fd, F_SETLK, &lck) < 0 ) fprintf(stderr, "%s[%d]: %s\n", *v, lck.l_pid, strerror(errno)); else printf("%s..ok\n", *v); close(fd); } } return 0; }
The programm hangs after executing ./script testfile.
Ruben
-- Ruben Puettmann ruben@puettmann.net http://www.puettmann.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |