We are running into odd file locking problems between our NFS server
which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
clients. When a HP-UX 10.20 client requests a file lock on a mounted
directory that resides on Linux, we get the following error: No locks
available
The kernel parameter nflocks is set to 200 which seems like a
reasonable limit. I'm pretty certain this limit isn't being reached,
but it is some type of NFS problem. Has anyone else seen this problem
and fixed it?
I've written a small program that demonstrates the problem:
[madden@hacksaw locktest]$ ./locktest locktest.c
Locking locktest.c...
fcntl: No locks available
/* locktest.c - compiled as: gcc -Wall -O2 locktest.c -o locktest */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static void setlock(int fd, struct flock fl)
{
if (fcntl(fd, F_SETLKW, &fl) == -1) {
perror("fcntl");
exit(EXIT_FAILURE);
}
}
int main(int argc, char **argv)
{
struct flock fl = { F_WRLCK, 0, 0, 0, 0 };
int fd;
if (argc != 2) {
printf("Usage: %s file\n", argv[0]);
exit(EXIT_FAILURE);
}
if ((fd = open(argv[1], O_RDWR)) == -1) {
perror("open");
exit(EXIT_FAILURE);
}
printf("Locking %s...\n", argv[1]);
fl.l_type = F_RDLCK;
setlock(fd, fl);
printf("%s locked successfully.\n\n", argv[1]);
printf("Unlocking %s...\n", argv[1]);
fl.l_type = F_UNLCK;
setlock(fd, fl);
printf("%s unlocked successfully.\n\n", argv[1]);
return (EXIT_SUCCESS);
}
|
|
0
|
|
|
|
Reply
|
madden
|
5/21/2004 3:26:52 PM |
|
madden@cmsrtp.com (Michael Madden) writes:
> We are running into odd file locking problems between our NFS server
> which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
> clients. When a HP-UX 10.20 client requests a file lock on a mounted
> directory that resides on Linux, we get the following error: No locks
> available
tcpdump output would probably shed some light. Also make sure rpc.lockd
is running on the redhat host.
tim
|
|
0
|
|
|
|
Reply
|
tbutler
|
5/22/2004 6:01:54 PM
|
|
> We are running into odd file locking problems between our NFS server
> which is running on Redhat 9.0 - kernel 2.4.20-8 and HP-UX 10.20
> clients. When a HP-UX 10.20 client requests a file lock on a mounted
> directory that resides on Linux, we get the following error: No locks
> available
I would run:
# rpcinfo -p <RH server>
...from one of the HP clients. This would at lesat reveal if you can contact
the portmapper on the server and whether a lock service is available. The
relevant network status monitor services should be able communicate. Perhaps
you need to check if this is allowed by your firewall configuration.
DaveN.
|
|
0
|
|
|
|
Reply
|
djn
|
5/24/2004 1:53:39 PM
|
|
We figured out the file locking problem. Either do one of the
following:
1.) Ensure the directory permissions are set to 755 and the file
permissions are set to 644. The file permissions were 640. Otherwise
the file cannot be locked.
2.) On the Linux server, add the insecure_locks option to
/etc/exports, re-export, and restart NFS.
Thanks,
Mike
|
|
0
|
|
|
|
Reply
|
madden
|
5/25/2004 10:02:10 PM
|
|
|
3 Replies
307 Views
(page loaded in 0.213 seconds)
Similiar Articles: remote X session from Linux to HPUX - comp.sys.hp.hpux... replacing linux file with ... running under HP-UX. Color names requested by the client will be resolved by the display server (Linux ... HP-UX 10.20 - comp.sys.hp.hpux Can I ... HP-UX 10.20 - comp.sys.hp.hpux... 99) and installed through console HP-UX 10.20 ... You are probably confusing the server vs. client ... remsh between HPUX and Linux - comp.sys.hp.hpux How to change the Locale ... HP UX 11.00 and VNC - comp.sys.hp.hpux... but I couldn't start vnc server or client ... coredump) - comp.sys.hp.hpux HP UX 11.00 and VNC - comp.sys.hp.hpux Exceeded file ... LVM Problems - HP UX 10.10 10.20 11.00 ... NFS getattr failed for server - comp.unix.solarisNetwork File System (NFS) The NFS client ... NFS problems on hp-ux - comp.sys.hp.hpux ... NFS slowdown - Solaris client, Linux server ... 7/9/2012 4:55:20 AM NFS performance tuning help - comp.unix.solarisNFS slowdown - Solaris client, Linux server ... wsize on a Solaris 9 NFS server? - comp.unix ... Shares on Solaris 10 ... Network File ... network performance on HP-UX 10.20 ... HPUX root account keeps getting disabled - comp.unix.admin ...... which version of HP-UX ... tb Tue Oct 10 13:36 root pts/tb Mon Sep 18 20 ... disabled - Unix Linux Forum ... HPUX root account keeps getting disabled - HP UX . comp.unix.solaris - page 9I had put the inflated zip file into the patch ... all: Hang in there, I am a EE first and a Linux ... Automated SysAdmin; Dot Files; HP-UX porting (ver: May 10, 2003) 0 5 (7/1 ... mc/serviceguard cluster fails once - comp.sys.hp.hpux... mistake the hpguy who configure my company's hp ux ... 30.30.1 NETWORK_INTERFACE lan8 HEARTBEAT_IP 20 ... HP-UX "ping -i" vs. Linux "ping -I" - comp.sys.hp.hpux mc/serviceguard ... Disabling telnet access for particular users - comp.unix.solaris ...These Windose using people have a telnet client available ... My preference, if possible, is to not have to lock and ... have a hetergenous UNIX environment like Solaris, HP-UX ... Advice on running Oracle with SGA > 20 GB - comp.databases.oracle ...... we have several servers where single image of OS (Solaris, AIX, HP-UX) has ... in > combination with LOCK_SGA? I have 64bit linux ... Reply: gerg: 10/10/2010 10:43:20 ... unix • View topic • Mandatory locking using fcntl on HP-UX 11 ...Quick file locking I want to read a ... Use Linux as NFS client with HP-UX 10.20 NFS server problem ... Redhat 9.0 as NFS client to access HP-UX 10.20 NFS server? HP-UX - Server Operating Systems Technical Comparison... CDE, which debuted with HP-UX 10.10. Starting with 10.20 ... Lock-down appropriate to hp-ux server use; Produce a profile script ... Darwin, DG-UX, FreeBSD, HP-UX, IRIX, Linux ... 7/22/2012 2:59:53 PM
|