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

* Re: 2.6.X File locking on NFS stil broken
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2004-06-09 20:41 UTC (permalink / raw)
  To: Ruben Puettmann; +Cc: linux-kernel, nfs

På on , 09/06/2004 klokka 15:17, skreiv 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
<snip>
> This little testscript I  used ( got it from a friend):

That script works fine for me: I haven't seen any hangs on locking in
any of the 2.6 series kernels so far.

What does 'rpcinfo -p' show on the client and server?

Cheers,
  Trond

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

* Re: 2.6.X File locking on NFS stil broken
  2004-06-09 20:41 ` Trond Myklebust
@ 2004-06-09 20:42   ` linux-kernel-owner
       [not found]     ` <1086814428.4078.35.camel@lade.trondhjem.org>
  0 siblings, 1 reply; 5+ messages in thread
From: linux-kernel-owner @ 2004-06-09 20:42 UTC (permalink / raw)
  To: Trond Myklebust

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

On Wed, Jun 09, 2004 at 04:41:12PM -0400, Trond Myklebust wrote:
 
> That script works fine for me: I haven't seen any hangs on locking in
> any of the 2.6 series kernels so far.

If I mount it with nolock it runs fine too ;-). I have not enough C
knowledge to see whree the bug is.

> 
> What does 'rpcinfo -p' show on the client and server?
> 

Server :


sslnfs:~# rpcinfo -p 
   Program Vers Proto   Port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp    759  status
    100024    1   tcp    762  status
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  32779  nlockmgr
    100021    3   udp  32779  nlockmgr
    100021    4   udp  32779  nlockmgr
    100005    1   udp    901  mountd
    100005    1   tcp    904  mountd
    100005    2   udp    901  mountd
    100005    2   tcp    904  mountd
    100005    3   udp    901  mountd
    100005    3   tcp    904  mountd

Client:

root@www10:[~] > rpcinfo -p
   Program Vers Proto   Port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100021    1   udp  32768  nlockmgr
    100021    3   udp  32768  nlockmgr
    100021    4   udp  32768  nlockmgr
    100024    1   udp    938  status
    100024    1   tcp    941  status


                Ruben


-- 
Ruben Puettmann
ruben@puettmann.net
http://www.puettmann.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.X File locking on NFS stil broken
       [not found]         ` <1086815623.4078.43.camel@lade.trondhjem.org>
@ 2004-06-09 21:24           ` Ruben Puettmann
  2004-06-10  2:58             ` Ryan Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: Ruben Puettmann @ 2004-06-09 21:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-kernel, nfs

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Wed, Jun 09, 2004 at 05:13:43PM -0400, Trond Myklebust wrote:
> På on , 09/06/2004 klokka 17:03, skreiv Ruben Puettmann:
> 
> > attached the strace and one tcpdump from the testprogramm.
> 
> According to that tcpdump, the server is denying you the lock because it
> is still in its grace period. 
> 
> During that period only clients that held locks before the server
> rebooted are allowed to reclaim those locks. Your client will need to
> wait until that grace period is over (usually ~ 1 minute or so).
> 

I have done a reboot on teh server ( It was up for over 315 day's ;-( )
now all runs fine seems to be an race condition. I will take a look on
it if this happend again. 

Thanks for your help !!


                Ruben

-- 
Ruben Puettmann
ruben@puettmann.net
http://www.puettmann.net

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: 2.6.X File locking on NFS stil broken
  2004-06-09 21:24           ` Ruben Puettmann
@ 2004-06-10  2:58             ` Ryan Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Anderson @ 2004-06-10  2:58 UTC (permalink / raw)
  To: linux-kernel

On Wed, Jun 09, 2004 at 11:24:30PM +0200, Ruben Puettmann wrote:
> On Wed, Jun 09, 2004 at 05:13:43PM -0400, Trond Myklebust wrote:
> > P? on , 09/06/2004 klokka 17:03, skreiv Ruben Puettmann:
> > 
> > > attached the strace and one tcpdump from the testprogramm.
> > 
> > According to that tcpdump, the server is denying you the lock because it
> > is still in its grace period. 
> > 
> > During that period only clients that held locks before the server
> > rebooted are allowed to reclaim those locks. Your client will need to
> > wait until that grace period is over (usually ~ 1 minute or so).
> 
> I have done a reboot on teh server ( It was up for over 315 day's ;-( )
> now all runs fine seems to be an race condition. I will take a look on
> it if this happend again. 

Did you change libc and/or your DNS configuration without restarting
nfs-common? (statd/lockd)

-- 

Ryan Anderson

^ 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