lkml.org 
[lkml]   [1999]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectknfs lock problem in 2.2.1
Date
From
	I have knfsd running on a linux 2.2.1 box that exports my 
home directory. On a different linux 2.2.1 I mount my home directory
and run the code at the end (it comes from GNU queue-1.11 so don't
blame me) on the client (that has nfs mounted the directory).
It prints
Lock error: No locks available
In /var/log/messages I find
kernel: lockd: failed to monitor 192.168.1.1
(naturally 192.168.1.1 is the server).

Should this work? I've tried a couple of patches I've seen
posted here by HJ Lu but none of them solved this.

Craig

--------------------- lock.c ---------------------------------------
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>

int main (void)
{
int fd;
struct flock l;
l.l_type = F_WRLCK;
l.l_whence = SEEK_SET;
l.l_start = 0;
l.l_len = 0;

if ((fd = open ("tmp.tmp", O_WRONLY)) < 0) {
printf ("Error opening file\n");
exit (1);
}
if (fcntl (fd, F_SETLK, &l) < 0) {
perror ("Lock error");
} else {
printf ("File locked\n");
sleep (5);
}
exit (0);
}
------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [from the cache]
©2003-2011 Jasper Spaans