[lkml]   [1999]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectknfs lock problem in 2.2.1
	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
(naturally 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.


--------------------- 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
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:50    [W:0.032 / U:1.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site