Page MenuHomeFreeBSD

fusefs: correctly set lock owner during FUSE_SETLK
ClosedPublic

Authored by asomers on Jun 2 2021, 9:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 3:45 AM
Unknown Object (File)
Dec 24 2023, 5:32 PM
Unknown Object (File)
Dec 23 2023, 12:07 AM
Unknown Object (File)
Oct 19 2023, 5:44 PM
Unknown Object (File)
Sep 2 2023, 4:13 AM
Unknown Object (File)
Aug 25 2023, 12:05 AM
Unknown Object (File)
Aug 17 2023, 1:36 PM
Unknown Object (File)
Aug 16 2023, 9:37 AM

Details

Summary

During FUSE_SETLK, the owner field should uniquely identify the calling
process. The fusefs module now sets it to the process's pid.
Previously, it expected the calling process to set it directly, which
was wrong.

libfuse also apparently expects the owner field to be set during
FUSE_GETLK, though I'm not sure why.

PR: 256005
Reported by: Agata <chogata@moosefs.pro>
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pfg, would you mind reviewing this change?

Hrm, it seems I had an inline comment that was never submitted.

tests/sys/fs/fusefs/locks.cc
281

Can you explain this part of the change (i.e., 0 instead of pid which was fake)

tests/sys/fs/fusefs/locks.cc
281

When I first wrote the test I thought that the caller of fcntl was supposed to set pid. But that was wrong. The kernel is supposed to set it, and we verify it on return.

This revision is now accepted and ready to land.Jun 25 2021, 2:48 AM