Followup: NFS file locking with SuSE 8.2 client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Linux Managers,

I still haven't solved my NFS file locking problem, but I have a little
more information. It isn't gconfd's fault (although gconfd does have an
over-optimistic view of the resilience of NFS file locking) because I have
reproduced the problem with a simple program.

It would be really useful if people with access to SuSE 8.2 NFS clients
could run my program to establish whether the problem is universal or if
there is something unusual about my configuration. Here is my experience:

(1) Attempts to lock a file on a SuSE 8.2 NFS client always fail. The
kernels concerned are k_deflt-2.4.20-39 and k_smp-2.4.20-40 (vanilla
kernels from SuSE 8.2 distro).
(2) Locking worked on these clients before they were upgraded.
(3) The NFS servers (both Linux and Tru64) succesfully support locking for
a variety of other clients including Tru64, Solaris and SuSE 8.0
(4) As an experiment I tried putting ALL: ALL in the
client's /etc/hosts.allow. It made no difference
(5) It still fails if the lock file is world-writable.
(6) /proc/mounts confirms that the file systems are mounted with the
'lock' option
(7) rpcinfo reports udp nlockmgr running on both client and server

To run my test do the following:
 $ cd somewhere-on-an-NFS-file-system
 $ gcc -o getlock getlock.c
 $ touch mylockfile
 $ ./getlock

And here is the program:

#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
main()
{
  int fd, stat;
  struct flock lck;
  lck.l_type = F_WRLCK;   /* setting a write lock */
  lck.l_whence = 0;       /* offset l_start from beginning of file */
  lck.l_start = 0;
  lck.l_len = 1;
  fd=open("mylockfile", O_RDWR, 0);
  if ( fd < 0 )
  {
    perror ("Open failed");
  }
  else
  {
    stat=fcntl (fd, F_SETLK, &lck);
    if ( stat == -1 )
    {
      perror ("SETLK failed");
    }
    else
    {
      printf ("SETLK worked\n");
    }
  }
}


Many thanks,
Bob

On Thu, 15 May 2003, Bob Vickers wrote:

Original message:

> Today I upgraded a machine from SuSE 8.0 to SuSE 8.2 and galeon stopped
> working. Galeon tries to start gconfd-2 and this fails; gconfd-2 also
> fails if you try and start it by hand.
>
> The message in the log is
>
> gconfd (zmac089-13318): Failed to get lock for daemon, exiting:
>     Failed to create or open '/home/ugrads/xxxxxxx/.gconfd/lock/ior'
>
> If I run strace on gconfd-2 I see
>
> open("/home/ugrads/xxxxxxx/.gconfd/lock/ior", O_RDWR) = 6
> fcntl64(6, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = -1
> ENOLCK (No locks available)
>
> I believe this an NFS locking problem. Galeon works if the home directory
> is on a local disc, but not if it is on an NFS file system. It fails with
> two different NFS servers: one of them SuSE Linux 8.0, one of them Tru64
> Unix 4.0G. Neither server has changed recently.
>
> Does anyone know of recent NFS client changes that might have affected
> locking? And are there any other tests I can try to confirm whether or not
> locking works at all or whether it is just gconfd that is affected?
>
> rpcinfo reports (on the client)
> /usr/sbin/rpcinfo -p localhost | grep lock
>     100021    1   udp  32768  nlockmgr
>     100021    3   udp  32768  nlockmgr
>     100021    4   udp  32768  nlockmgr
>
> I'm rather stumped: any ideas gratefully received.
>
> Bob
> ==============================================================
> Bob Vickers                     R.Vickers@cs.rhul.ac.uk
> Dept of Computer Science, Royal Holloway, University of London
> WWW:    http://www.cs.rhul.ac.uk/home/bobv
> Phone:  +44 1784 443691
>

==============================================================
Bob Vickers                     R.Vickers@cs.rhul.ac.uk
Dept of Computer Science, Royal Holloway, University of London
WWW:    http://www.cs.rhul.ac.uk/home/bobv
Phone:  +44 1784 443691
_______________________________________________
LinuxManagers mailing list - http://www.linuxmanagers.org
submissions: LinuxManagers@linuxmanagers.org
subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers

[Index of Archives]     [Kernel]     [Linux SCSI]     [Video 4 Linux]     [Linux Admin]     [Yosemite News]

  Powered by Linux