Re: nfs: lock stuck after interrupt

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Miklos Szeredi
Date: Friday, April 18, 2008 - 4:07 am

> We brought up this specific issue a few weeks ago in this thread:

Thanks for the info.

1) I pulled the devel branch of nfs-2.6.git and tested the same setup,
   with exactly the same result as previously.

2) then I added your patch on top of that, which did change something
   but not really for the better: now even the restarted lock request
   doesn't succeed after the interrupt.

According to my suspicion, this is an issue in the server, while both
referenced patches touch only the client.

Appended little test program which I'm trying out locking with.

Miklos
---

#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>

static void int_handler(int s)
{
	(void) s;
	fprintf(stderr, "signal caught\n");
}

int main(int argc, char *argv[])
{
	char *filename = argv[1];
	int res;
	int fd;

	if (argc != 2) {
		fprintf(stderr, "usage: %s filename\n", argv[0]);
		return 1;
	}

	signal(SIGINT, int_handler);

	fd = open(filename, O_RDWR | O_CREAT, 0666);
	if (fd == -1) {
		perror("open");
		return 1;
	}

	res = lockf(fd, F_LOCK, 100);
	if (res == -1) {
		perror("lockf");
		return 1;
	}
	printf("locked\n");
	pause();
	return 0;
}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
nfs: lock stuck after interrupt, Miklos Szeredi, (Thu Apr 17, 10:44 am)
Re: nfs: lock stuck after interrupt, Aaron Wiebe, (Thu Apr 17, 12:30 pm)
Re: nfs: lock stuck after interrupt, Miklos Szeredi, (Fri Apr 18, 4:07 am)
Re: nfs: lock stuck after interrupt, Aaron Wiebe, (Fri Apr 18, 5:20 am)
Re: nfs: lock stuck after interrupt, J. Bruce Fields, (Sun Apr 20, 11:45 am)
Re: nfs: lock stuck after interrupt, Miklos Szeredi, (Sun Apr 20, 12:24 pm)