From: Ruben Puettmann Subject: 2.6.X File locking on NFS stil broken Date: Wed, 9 Jun 2004 21:17:58 +0200 Sender: linux-kernel-owner@vger.kernel.org Message-ID: <20040609191758.GA29969@puettmann.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: nfs@lists.sourceforge.net Return-path: To: linux-kernel@vger.kernel.org List-ID: 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 #include #include #include #include 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