Page MenuHomeFreeBSD

kern_copy_file_range(): handle rangelock recursion
ClosedPublic

Authored by kib on Aug 27 2024, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 11:01 PM
Unknown Object (File)
Mon, Nov 11, 3:07 PM
Unknown Object (File)
Sun, Nov 10, 1:00 PM
Unknown Object (File)
Sun, Oct 20, 1:18 AM
Unknown Object (File)
Oct 4 2024, 3:04 AM
Unknown Object (File)
Oct 3 2024, 10:49 PM
Unknown Object (File)
Oct 3 2024, 2:38 AM
Unknown Object (File)
Oct 3 2024, 2:17 AM
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.