public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.X File locking on NFS stil broken
@ 2004-06-09 19:17 Ruben Puettmann
  2004-06-09 20:41 ` Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: Ruben Puettmann @ 2004-06-09 19:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: nfs


                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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-10  2:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-09 19:17 2.6.X File locking on NFS stil broken Ruben Puettmann
2004-06-09 20:41 ` Trond Myklebust
2004-06-09 20:42   ` linux-kernel-owner
     [not found]     ` <1086814428.4078.35.camel@lade.trondhjem.org>
     [not found]       ` <20040609210313.GE29969@puettmann.net>
     [not found]         ` <1086815623.4078.43.camel@lade.trondhjem.org>
2004-06-09 21:24           ` Ruben Puettmann
2004-06-10  2:58             ` Ryan Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox