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

xdg-document-portal: implement flock #1353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lufia
Copy link

@lufia lufia commented Apr 29, 2024

I implemented flock operation of FUSE.

This is needed for Steam client.

Tested

I tested whether the new xdg-document-portal accepts flock(2) syscall with flock(1).

$ umount /run/user/60331/doc
$ meson compile -C _build
$ ./_build/document-portal/xdg-document-portal &

$ cd /run/user/60331/doc
$ touch lock.L
$ flock -n lock.L sleep 100

Then, within 100 seconds, I ran flock(1) in other terminal session.

$ flock -n lock.L ls || echo BAD
BAD

I checked blocking operations are rejected.

$ flock lock.L ls
flock: lock.L: Function not implemented

$ flock -s lock.L ls
flock: lock.L: Function not implemented

@lufia lufia marked this pull request as ready for review April 29, 2024 08:43
@swick
Copy link
Contributor

swick commented Apr 29, 2024

Looks like this will block the entire document portal when any file is blocked due to flock.

@lufia
Copy link
Author

lufia commented Apr 29, 2024

Hi, @swick
I mitigated not to block entire document-portal by rejecting blocking operations of flock.
Steam client works well in my Arch Linux box.

@hfiguiere Thanks for your suggestion!

@GeorgesStavracas
Copy link
Member

Thanks for the patch. Please squash the suggestion commit into a single commit.

@swick
Copy link
Contributor

swick commented Apr 29, 2024

Supporting flock only for certain option is very suspicious to me. This needs review from someone who knows about fuse and filesystems.

This is needed for Steam client

Signed-off-by: Kyohei KADOTA <lufia@lufia.org>
Co-authored-by: Hubert Figuière <hub@figuiere.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

None yet

4 participants