lkml.org 
[lkml]   [2004]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subject2.6.X File locking on NFS stil broken
From

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/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.071 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site