Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/kern/t19 and t23 fcntl posix advisory record lock tests fails #102

Closed
garlick opened this issue Jul 6, 2024 · 1 comment
Closed

Comments

@garlick
Copy link
Member

garlick commented Jul 6, 2024

Problem: tests/kern/t19 fails on linux-6.9.3 (ubuntu 22.04)


$ diff -u t19.exp t19.out
--- t19.exp	2022-02-22 21:08:52.895878041 -0800
+++ t19.out	2024-07-06 07:24:47.000683222 -0700
@@ -72,16 +72,7 @@
 tfcntl2: fd: write-locked 1 byte
 tfcntl2: child forked
 tfcntl2: fd2: open (child)
-tfcntl2: fd2: write-locked rest of file
-tfcntl2: child exited normally
-tfcntl2: fd: closed
-tfcntl2: 5. Non-conflicting read and write locks CAN be held by two processes
-tfcntl2: fd: open
-tfcntl2: fd: write-locked 1 byte
-tfcntl2: child forked
-tfcntl2: fd2: open (child)
-tfcntl2: fd2: read-locked rest of file
-tfcntl2: child exited normally
-tfcntl2: fd: closed
+tfcntl2: fd2: write-lock rest of file failed: Resource temporarily unavailable
+tfcntl2: child exited with 1, aborting
 kconjoin: t19 exited with rc=0
 kconjoin: diod exited with rc=0

t23 also fails:

$ diff -u t23.exp t23.out
--- t23.exp	2022-02-22 21:08:52.895878041 -0800
+++ t23.out	2024-07-06 07:24:47.061684733 -0700
@@ -72,56 +72,6 @@
 tfcntl3: fd: open O_RDWR
 tfcntl3: fd: read-locked
 tfcntl3: fd2: open O_RDWR
-tfcntl3: fd2: write-locked
-tfcntl3: fd2: closed
-tfcntl3: fd: closed
-tfcntl3: 3. Upgrade byte range of write lock (one fd)
-tfcntl3: fd: open O_RDWR
-tfcntl3: fd: write-locked 1 byte
-tfcntl3: fd: write-locked entire file
-tfcntl3: fd: closed
-tfcntl3: 4. Downgrade byte range of write lock (one fd)
-tfcntl3: fd: open O_RDWR
-tfcntl3: fd: write-locked entire file
-tfcntl3: fd: write-locked 1 byte
-tfcntl3: fd: closed
-tfcntl3: 5. Downgrade write lock to read lock (one fd)
-tfcntl3: fd: open O_RDWR
-tfcntl3: fd: write-locked
-tfcntl3: fd: read-locked
-tfcntl3: fd: closed
-tfcntl3: 6. Read lock with O_RDONLY should succeed
-tfcntl3: fd: open O_RDONLY
-tfcntl3: fd: read-locked
-tfcntl3: fd: closed
-tfcntl3: 7. Read lock with O_WRONLY should fail
-tfcntl3: fd: open O_WRONLY
-tfcntl3: fd: fcntl F_SETLK rdlock failed: Bad file descriptor
-tfcntl3: fd: closed
-tfcntl3: 8. Write lock with O_RDONLY should fail
-tfcntl3: fd: open O_RDONLY
-tfcntl3: fd: fcntl F_SETLK wrlock failed: Bad file descriptor
-tfcntl3: fd: closed
-tfcntl3: 9. Write lock with O_WRONLY should succeed
-tfcntl3: fd: open O_WRONLY
-tfcntl3: fd: write-locked
-tfcntl3: fd: closed
-tfcntl3: 10. Write lock is not inherited across a fork
-tfcntl3: fd: open O_RDWR
-tfcntl3: fd: write-locked
-tfcntl3: child forked
-tfcntl3: fd: read-lock failed (child): Resource temporarily unavailable
-tfcntl3: child exited normally
-tfcntl3: fd: closed
-tfcntl3: 11. Write lock is dropped if another fd to same file is closed
-tfcntl3: fd: open O_RDWR
-tfcntl3: fd: write-locked
-tfcntl3: fd2: open O_RDWR
-tfcntl3: fd2: closed
-tfcntl3: child forked
-tfcntl3: fd: closed (child)
-tfcntl3: fd2: open O_RDWR (child)
-tfcntl3: fd2: read-locked (child)
-tfcntl3: child exited normally
+tfcntl3: fd2: fcntl F_SETLK wrlock failed: Resource temporarily unavailable
 kconjoin: t23 exited with rc=0
 kconjoin: diod exited with rc=0
snogge added a commit to snogge/diod that referenced this issue Aug 29, 2024
snogge added a commit to snogge/diod that referenced this issue Aug 29, 2024
@snogge snogge mentioned this issue Aug 29, 2024
garlick pushed a commit to snogge/diod that referenced this issue Dec 29, 2024
@garlick garlick changed the title kernel fcntl test fails tests/kern/t19 and t23 fcntl posix advisory record lock tests fails Dec 29, 2024
@garlick
Copy link
Member Author

garlick commented Jan 16, 2025

Tests of record locking are not going to be successful because

/* Locking note:
 * Implement POSIX locks in terms of BSD flock locks.
 * This at least gets distributed whole-file locking to work.
 * Strategies for distributed record locking will deadlock.
 */

The reason for the expected failure should be made more obvious.

garlick added a commit to garlick/diod that referenced this issue Jan 17, 2025
Problem: tests/kern/t19 and tests/kern/t23 both test POSIX
record locking through diod, but diod doesn't support it.

Now that there is a unit test that demostrates diod's inability to
handle record locks, these tests are not needed.  Drop them.

Fixes chaos#102.
@mergify mergify bot closed this as completed in e08d71e Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant