Page MenuHomeFreeBSD

fusefs: correctly set lock owner during FUSE_SETLK

Authored by asomers on Jun 2 2021, 9:44 PM.
Referenced Files
Unknown Object (File)
Wed, May 15, 2:47 AM
Unknown Object (File)
Sat, May 11, 3:56 PM
Unknown Object (File)
Wed, May 8, 5:54 AM
Unknown Object (File)
Wed, May 8, 5:53 AM
Unknown Object (File)
Wed, May 8, 5:53 AM
Unknown Object (File)
Wed, May 8, 2:22 AM
Unknown Object (File)
Wed, May 1, 2:11 AM
Unknown Object (File)
Tue, Apr 30, 4:31 AM



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 <>
MFC after: 2 weeks

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

pfg, would you mind reviewing this change?

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


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


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