Page MenuHomeFreeBSD

kern_copy_file_range(): handle rangelock recursion
ClosedPublic

Authored by kib on Aug 27 2024, 9:39 PM.
Tags
None
Referenced Files
F107191780: D46465.diff
Sat, Jan 11, 10:44 AM
Unknown Object (File)
Tue, Dec 31, 10:17 PM
Unknown Object (File)
Thu, Dec 19, 6:17 PM
Unknown Object (File)
Sun, Dec 15, 3:28 PM
Unknown Object (File)
Sat, Dec 14, 5:19 PM
Unknown Object (File)
Dec 5 2024, 1:29 AM
Unknown Object (File)
Nov 12 2024, 11:01 PM
Unknown Object (File)
Nov 11 2024, 3:07 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Aug 27 2024, 9:39 PM

Re-check that we are still in cheating mode after CAS failure to set DRAINING.

The fusefs tests are still failing with this change. :-(

To run fusefs tests:

kldload fusefs.ko
cd /usr/tests/sys/fs/fusefs

then

kyua test

or execute each group directly:

./copy_file_range

Source codes are at src/tests/sys/fs/fusefs.

Actually switch to non-cheating mode in rangelock_may_recurse().

With this update, copy_file_range() test does not hang for me. OTOH, I see write test timing out, but no hanging or unkillable processes are left. It might be due to my machine having real hw serial console which is slow, and fusefs tests are quite chatty.

Could you please confirm whether updated patch works for you?

I have tested it and all the fusefs tests are passed. Thanks very much!

sys/kern/kern_rangelock.c
92

The cast is not needed (anymore).

788

Why do these operations need release semantics?

kib marked 2 inline comments as done.

Remove _rel modifier.
Remove unneeded casts.

sys/kern/kern_rangelock.c
783

Should we restart this loop if the cmpset fails?

kib marked an inline comment as done.

Fix draining case when CAS failed.

This revision is now accepted and ready to land.Aug 28 2024, 2:29 PM

I have tested again with the latest patch and all the tests passed.