All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruben Puettmann <ruben@puettmann.net>
To: linux-kernel@vger.kernel.org
Cc: nfs@lists.sourceforge.net
Subject: 2.6.X File locking on NFS stil broken
Date: Wed, 9 Jun 2004 21:17:58 +0200	[thread overview]
Message-ID: <20040609191758.GA29969@puettmann.net> (raw)


                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

             reply	other threads:[~2004-06-09 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 19:17 Ruben Puettmann [this message]
2004-06-09 20:41 ` 2.6.X File locking on NFS stil broken Trond Myklebust
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040609191758.GA29969@puettmann.net \
    --to=ruben@puettmann.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.