Bug 21326
Summary: | flock() does not work properly on 2.4 kernels | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Nils Philippsen <nphilipp> |
Component: | kernel | Assignee: | Michael K. Johnson <johnsonm> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Aaron Brown <abrown> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2000-11-28 06:15:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Nils Philippsen
2000-11-25 14:12:08 UTC
Hmm, I checked back with my work machine and it does show the error even with glibc-2.1.92-14... I extended the test program to try POSIX lockf() locks as well and they do succeed in any case: --- 8< --- #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/file.h> #include <fcntl.h> #include <unistd.h> int main (int argc, char** argv) { int fd; fd = open ("/tmp/foo", O_CREAT|O_RDWR, 0644); if (flock (fd, LOCK_EX | LOCK_NB)) { perror ("flock()"); } else { printf ("Locking with flock() succeeded.\n"); } if (lockf (fd, F_TLOCK, 0)) { perror ("lockf()"); } else { printf ("Locking with lockf() succeeded.\n"); } printf ("Waiting...\n"); pause (); close (fd); } --- >8 --- Now I'm a bit puzzled -- The only difference between the machines I can think of is the Athlon processor in my work machine and the PII at home. I tried the program on a dual PIII box running 2.4.0-test4 as well and both tests succeed. I don't know whether the older kernel causes the tests not to fail or the CPU (I can't upgrade the kernel there because it's a production server and some people most likely would be pis^Wupset if I rebooted it). Reassigning to kernel, glibc's flock is just plain assembly stub around flock syscall, so it must be kernel issue. Just for the record: I don't think that it has any impact on the problem (*), but I have installed a bunch of updated RPMS directly from porky, some of them before QA passed. (*): because e.g. the test program should really only depend on glibc and the kernel (I would be seriously surprised if anything else had an influence on it) I got back on this and tried it again with 2.4.0-test12 (and glibc-2.2-9 but I doubt that this should matter for me after Jakub's comment) and apparently it works. I didn't see anything related in the kernel changelogs, so I guess it's either me seeing badly or that bug having been fixed either silently or accidentally. |