* [parisc-linux] file locking problems?
@ 2000-10-09 3:00 Randolph Chung
2000-10-09 3:52 ` David Huggins-Daines
2000-10-09 5:53 ` Randolph Chung
0 siblings, 2 replies; 3+ messages in thread
From: Randolph Chung @ 2000-10-09 3:00 UTC (permalink / raw)
To: parisc-linux; +Cc: debian-hppa
[-- Attachment #1: Type: text/plain, Size: 748 bytes --]
Hi all,
I'm seeing some weird behavior with file locking on my hppa box:
update-passwd (a Debian package) makes a call to lckpwdf. That fails
with an "Invalid argument" message. It looks like lckpwdf internally uses
fcntl() locking, so I tried that and it too fails with an "Invalid
argument" message. This happens both on nfs and local ext2 fs.
Similar tests with flock() seems to work ok.
Any ideas? This is using dhd's latest glibc build. My testing program is
attached. I've verified that it works on ext2 fs on i386 and SPARC. Over
nfs it does give an error message (No locks available).
The test program I used is attached.
randolph
--
@..@ http://www.TauSq.org/
(----)
( >__< )
^^ ~~ ^^
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: locktest.c --]
[-- Type: text/x-csrc, Size: 491 bytes --]
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
struct flock l;
int fd;
if ((fd = open("test.lck", O_CREAT|O_RDWR)) < 0)
{
perror("open");
return -1;
}
memset(&l, 0, sizeof(l));
l.l_type = F_RDLCK;
if (fcntl(fd, F_SETLK, &l) < 0)
{
perror("fcntl");
return -1;
}
close(fd);
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [parisc-linux] file locking problems?
2000-10-09 3:00 [parisc-linux] file locking problems? Randolph Chung
@ 2000-10-09 3:52 ` David Huggins-Daines
2000-10-09 5:53 ` Randolph Chung
1 sibling, 0 replies; 3+ messages in thread
From: David Huggins-Daines @ 2000-10-09 3:52 UTC (permalink / raw)
To: Randolph Chung; +Cc: parisc-linux, debian-hppa
Randolph Chung <randolph@tausq.org> writes:
> update-passwd (a Debian package) makes a call to lckpwdf. That fails
> with an "Invalid argument" message. It looks like lckpwdf internally uses
> fcntl() locking, so I tried that and it too fails with an "Invalid
> argument" message. This happens both on nfs and local ext2 fs.
> Similar tests with flock() seems to work ok.
Lots of things report this actually - if you look in your log files
you'll see lots of "utmp file is locked/read" - also in bootup
messages there will be a "can't lock <whatever>".
I have a feeling this might just be generally broken in the revision
of the kernel we're using, though it could be a problem with LFS in
our glibc if it is trying to use fcntl64().
I suspect that our LFS stuff is generally broken (lseek64() is, at
least) and plan to investigate further on Tuesday.
--
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: file locking problems?
2000-10-09 3:00 [parisc-linux] file locking problems? Randolph Chung
2000-10-09 3:52 ` David Huggins-Daines
@ 2000-10-09 5:53 ` Randolph Chung
1 sibling, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2000-10-09 5:53 UTC (permalink / raw)
To: parisc-linux; +Cc: debian-hppa
> update-passwd (a Debian package) makes a call to lckpwdf. That fails
> with an "Invalid argument" message. It looks like lckpwdf internally uses
> fcntl() locking, so I tried that and it too fails with an "Invalid
> argument" message. This happens both on nfs and local ext2 fs.
> Similar tests with flock() seems to work ok.
as it turns out, it looks like there's a glibc<->kernel mismatch.
the kernel defines F_RDLCK as 1, and glibc has it defined as 0. dhd is
aware of this and say he'll look into fixing this later this week.
randolph
--
Debian Developer <tausq@debian.org>
http://www.TauSq.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-10-09 5:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-09 3:00 [parisc-linux] file locking problems? Randolph Chung
2000-10-09 3:52 ` David Huggins-Daines
2000-10-09 5:53 ` Randolph Chung
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.